-
Notifications
You must be signed in to change notification settings - Fork 9
No folders fix #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
No folders fix #138
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f1394c2
Fixed the settings form; changed methods in utils to work with the ne…
isc-svelury 24cca22
Unit tests for NameToInternalName bug fixes
isc-svelury babc7f2
Tooltip text changes when the NoFolders switch is toggled
isc-svelury 1a83979
Fix errors in setting up mappings for tests
isc-svelury dc6d442
Change percent-class handling, kill mappings before merging
isc-svelury ee21bf1
Test .DFI filenames for abstract document type instead of .HL7
isc-svelury File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
test/UnitTest/SourceControl/Git/NameToInternalNameTest.cls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Import SourceControl.Git | ||
|
||
Include SourceControl.Git | ||
|
||
Class UnitTest.SourceControl.Git.NameToInternalNameTest Extends %UnitTest.TestCase | ||
{ | ||
|
||
Property Mappings [ MultiDimensional ]; | ||
|
||
Method TestRegularClassNames() | ||
{ | ||
// Regular class that exists | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("cls\SourceControl\Git\Utils.cls"),"SourceControl.Git.Utils.CLS") | ||
// Regular class that doesn't exist and we ignore non-existent classes | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("cls\SourceControl\Git\DoesNotExist.cls"),"") | ||
// Regular class that doesn't exist and we don't ignore non-existent classes | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("cls\SourceControl\Git\DoesNotExist.cls", 1, 0),"SourceControl.Git.DoesNotExist.CLS") | ||
} | ||
|
||
Method TestPercentClassNames() | ||
{ | ||
// % class that exists but we ignore % classes | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("cls\"_##class(SourceControl.Git.Utils).PercentClassReplace()_"Studio\Extension\Base.cls"),"") | ||
// % class that exists and we don't ignore % classes | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("cls\"_##class(SourceControl.Git.Utils).PercentClassReplace()_"Studio\Extension\Base.cls", 0),"%Studio.Extension.Base.CLS") | ||
// % class that doesn't exist and we ignore non-existent classes | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("cls\"_##class(SourceControl.Git.Utils).PercentClassReplace()_"Studio\Extension\DoesNotExist.cls", 0),"") | ||
// % class that doesn't exist and we don't ignore non-existent classes | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("cls\"_##class(SourceControl.Git.Utils).PercentClassReplace()_"Studio\Extension\DoesNotExist.cls", 0, 0),"%Studio.Extension.DoesNotExist.CLS") | ||
} | ||
|
||
Method TestAbstractDocumentClassNames() | ||
{ | ||
// %Studio.AbstractDocument type that exists | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("test\dfi\test2.pivot.xml"),"test2.pivot.DFI") | ||
// %Studio.AbstractDocument type that does not exist and we ignore non-existent classes | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("test\dfi\DoesNotExist.xml"),"") | ||
// %Studio.AbstractDocument type that doesn't exist and we don't ignore non-existent classes | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("test\dfi\DoesNotExist.xml", 1, 0),"DoesNotExist.DFI") | ||
} | ||
|
||
Method TestStaticFileNames() | ||
{ | ||
// Static file that shouldn't be on the server | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("git-webui\src\js\git-webui.js"),"") | ||
// Static file that shouldn't be on the server but we don't ignore non-existent classes | ||
do $$$AssertEquals(##class(Utils).NameToInternalName("git-webui\src\js\git-webui.js", 1, 0),"") | ||
} | ||
|
||
Method OnBeforeAllTests() As %Status | ||
{ | ||
merge ..Mappings = @##class(SourceControl.Git.Utils).MappingsNode() | ||
kill @##class(SourceControl.Git.Utils).MappingsNode() | ||
set $$$SourceMapping("CLS", "*") = "cls/" | ||
set $$$SourceMapping("DFI", "*", "NoFolders") = "test/dfi/" | ||
quit $$$OK | ||
} | ||
|
||
Method %OnClose() As %Status | ||
{ | ||
kill @##class(SourceControl.Git.Utils).MappingsNode() | ||
merge @##class(SourceControl.Git.Utils).MappingsNode() = ..Mappings | ||
quit $$$OK | ||
} | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should kill the mappings node as well (first). As it stands it'll leave the nspace/hl7/ in place.