Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Commit

Permalink
remove dunit, fix library configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Nov 24, 2019
1 parent eec0617 commit fdc3f39
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
13 changes: 10 additions & 3 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
],
"configurations": [
{
"name": "generic"
"name": "executable",
"targetType": "executable"
},
{
"name": "library",
"targetType": "library",
"excludedSourceFiles": [
"source/app.d"
]
},
{
"name": "unittest",
Expand All @@ -32,11 +40,10 @@
],
"mainSourceFile": "bin/ut.d",
"excludedSourceFiles": [
"source/main.d",
"source/app.d",
"source/workspaced/info.d"
],
"dependencies": {
"dunit": "*",
"unit-threaded": "*"
}
}
Expand Down
36 changes: 17 additions & 19 deletions source/workspaced/com/dlangui.d
Original file line number Diff line number Diff line change
Expand Up @@ -286,40 +286,38 @@ LocationInfo getLocationInfo(scope const(char)[] code, int pos)

unittest
{
import dunit.toolkit;

auto info = getLocationInfo(" ", 0);
assertEqual(info.type, LocationType.RootMember);
shouldEqual(info.type, LocationType.RootMember);
info = getLocationInfo(`TableLayout { mar }`, 17);
assertEqual(info.itemScope, ["TableLayout", "mar"]);
assertEqual(info.type, LocationType.Member);
shouldEqual(info.itemScope, ["TableLayout", "mar"]);
shouldEqual(info.type, LocationType.Member);
info = getLocationInfo(`TableLayout { margins: 20; paddin }`, 33);
assertEqual(info.itemScope, ["TableLayout", "paddin"]);
assertEqual(info.type, LocationType.Member);
shouldEqual(info.itemScope, ["TableLayout", "paddin"]);
shouldEqual(info.type, LocationType.Member);
info = getLocationInfo(
"TableLayout { margins: 20; padding : 10\n\t\tTextWidget { text: \"} foo } }", 70);
assertEqual(info.itemScope, ["TableLayout", "TextWidget", "text"]);
assertEqual(info.type, LocationType.PropertyValue);
shouldEqual(info.itemScope, ["TableLayout", "TextWidget", "text"]);
shouldEqual(info.type, LocationType.PropertyValue);
info = getLocationInfo(`TableLayout { margins: 2 }`, 24);
assertEqual(info.itemScope, ["TableLayout", "margins"]);
assertEqual(info.type, LocationType.PropertyValue);
shouldEqual(info.itemScope, ["TableLayout", "margins"]);
shouldEqual(info.type, LocationType.PropertyValue);
info = getLocationInfo(
"TableLayout { margins: 20; padding : 10\n\t\tTextWidget { text: \"} foobar\" } } ", int.max);
assertEqual(info.itemScope, [""]);
assertEqual(info.type, LocationType.RootMember);
shouldEqual(info.itemScope, [""]);
shouldEqual(info.type, LocationType.RootMember);
info = getLocationInfo(
"TableLayout { margins: 20; padding : 10\n\t\tTextWidget { text: \"} foobar\"; } }", 69);
assertEqual(info.itemScope, ["TableLayout", "TextWidget", "text"]);
assertEqual(info.type, LocationType.PropertyValue);
shouldEqual(info.itemScope, ["TableLayout", "TextWidget", "text"]);
shouldEqual(info.type, LocationType.PropertyValue);
info = getLocationInfo("TableLayout {\n\t", int.max);
assertEqual(info.itemScope, ["TableLayout", ""]);
assertEqual(info.type, LocationType.Member);
shouldEqual(info.itemScope, ["TableLayout", ""]);
shouldEqual(info.type, LocationType.Member);
info = getLocationInfo(`TableLayout {
colCount: 2
margins: 20; padding: 10
backgroundColor: "#FFFFE0"
TextWidget {
t`, int.max);
assertEqual(info.itemScope, ["TableLayout", "TextWidget", "t"]);
assertEqual(info.type, LocationType.Member);
shouldEqual(info.itemScope, ["TableLayout", "TextWidget", "t"]);
shouldEqual(info.type, LocationType.Member);
}

0 comments on commit fdc3f39

Please sign in to comment.