Autodesk-AutoCAD / AutoLispExt

Visual Studio Code Extension for AutoCAD® AutoLISP
https://marketplace.visualstudio.com/items?itemName=Autodesk.autolispext
Apache License 2.0
87 stars 30 forks source link

Added test cases for lisp extension format with mock method #121

Closed nigma456 closed 3 years ago

nigma456 commented 3 years ago
Objective

Most complex part of the lisp extension work is formatting so we want to add more and more test cases to avoid regressions.

Abstractions

In this submission I have added some test cases to cover the lisp extension formatting feature.

  1. The lisp extension format has 4 settings which exposed to users in the vscode setting for extension. format.CloseParenthesisStyle : 'Same line' | 'New line with outer identation' format.MaxLineChars || 85 format.LongListFormatStyle : 'Single Column' | 'Fill to Margin' format.NarrowStyleIndent || 2 we tested the formatting by assigning different value for these settings.

  2. Since in the Github CI virtual enviornment the lisp extension can't be activated when running the unit test we have to use mock method to do the test.

  3. All the 16 test cases covered various scenarios that I can image, may need to add more cases in the future. After this submission the code coverage for format reached to 62% image image

  4. Next will try to add test cases for format selection.

Tests performed

Pass local test and CI on Github

Screen shot
LanDong-adsk commented 3 years ago

Are these lisp files OK to be published to public? any intellectual property concerns?

Sen-real commented 3 years ago

@nigma456 it looks good, but please merge with latest main code first