-
-
Notifications
You must be signed in to change notification settings - Fork 455
Fix bugs in explorer plugin #1817
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
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
2e4127c
Catch specifc exception
VictoriousRaptor 6efa9d1
Only expand environment var when path starts with %
VictoriousRaptor 983f0aa
Use a static dictionary for environment vars
VictoriousRaptor 009ee3d
Simplify environment variable detection
VictoriousRaptor 52e7299
Change context and settings to non static
VictoriousRaptor 51f5d8a
Add new constructor for EngineNotAvailableException
VictoriousRaptor 383298a
Fix null subtitle when creating disk result
VictoriousRaptor a6b7c58
Fix subpath check
VictoriousRaptor 2c36692
Use case-insensitve comparator for path
VictoriousRaptor 3226889
Remove TranslateEnvironmentVariablePath
VictoriousRaptor ac92b93
Move IsSubPathOf to SharedCommands
VictoriousRaptor beb1449
Rename method and add option to allow equality
VictoriousRaptor b42fc54
Add test for PathContains()
VictoriousRaptor 4bea50d
Add unit test for PathEqualityComparator
VictoriousRaptor 03f062c
Fix build error
VictoriousRaptor fefb137
fix test format
jjw24 b77bfea
update test name
jjw24 768ed4f
Update wording
VictoriousRaptor 504fb4a
Display environment vars in upper case
VictoriousRaptor 4d267fe
Fix incorrect %homepath% parsing
VictoriousRaptor 966d3e7
Fix environment variable expansion logic
VictoriousRaptor 71a2f99
Set environment var dict in LoadEnvironmentStringPaths()
VictoriousRaptor b739bb4
Fix CI test failure
VictoriousRaptor f5cc792
Return empty when operation canceled
VictoriousRaptor babffe9
Disable unused import warning
VictoriousRaptor dd02ad3
Refactor
VictoriousRaptor 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| using Flow.Launcher.Plugin.SharedCommands; | ||
| using NUnit.Framework; | ||
|
|
||
| namespace Flow.Launcher.Test | ||
| { | ||
| [TestFixture] | ||
|
|
||
| public class FilesFoldersTest | ||
| { | ||
| // Testcases from https://stackoverflow.com/a/31941905/20703207 | ||
| // Disk | ||
| [TestCase(@"c:", @"c:\foo", true)] | ||
jjw24 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [TestCase(@"c:\", @"c:\foo", true)] | ||
| // Slash | ||
| [TestCase(@"c:\foo\bar\", @"c:\foo\", false)] | ||
| [TestCase(@"c:\foo\bar", @"c:\foo\", false)] | ||
| [TestCase(@"c:\foo", @"c:\foo\bar", true)] | ||
| [TestCase(@"c:\foo\", @"c:\foo\bar", true)] | ||
| // File | ||
| [TestCase(@"c:\foo", @"c:\foo\a.txt", true)] | ||
| [TestCase(@"c:\foo", @"c:/foo/a.txt", true)] | ||
| [TestCase(@"c:\FOO\a.txt", @"c:\foo", false)] | ||
| [TestCase(@"c:\foo\a.txt", @"c:\foo\", false)] | ||
| [TestCase(@"c:\foobar\a.txt", @"c:\foo", false)] | ||
| [TestCase(@"c:\foobar\a.txt", @"c:\foo\", false)] | ||
| [TestCase(@"c:\foo\", @"c:\foo.txt", false)] | ||
| // Prefix | ||
| [TestCase(@"c:\foo", @"c:\foobar", false)] | ||
| [TestCase(@"C:\Program", @"C:\Program Files\", false)] | ||
| [TestCase(@"c:\foobar", @"c:\foo\a.txt", false)] | ||
| [TestCase(@"c:\foobar\", @"c:\foo\a.txt", false)] | ||
| // Edge case | ||
| [TestCase(@"c:\foo", @"c:\foo\..\bar\baz", false)] | ||
| [TestCase(@"c:\bar", @"c:\foo\..\bar\baz", true)] | ||
| [TestCase(@"c:\barr", @"c:\foo\..\bar\baz", false)] | ||
| // Equality | ||
| [TestCase(@"c:\foo", @"c:\foo", false)] | ||
| [TestCase(@"c:\foo\", @"c:\foo", false)] | ||
| [TestCase(@"c:\foo", @"c:\foo\", false)] | ||
| public void GivenTwoPaths_WhenCheckPathContains_ThenShouldBeExpectedResult(string parentPath, string path, bool expectedResult) | ||
| { | ||
| Assert.AreEqual(expectedResult, FilesFolders.PathContains(parentPath, path)); | ||
| } | ||
|
|
||
| [TestCase(@"c:\foo", @"c:\foo", true)] | ||
| [TestCase(@"c:\foo\", @"c:\foo", true)] | ||
| [TestCase(@"c:\foo", @"c:\foo\", true)] | ||
| public void GivenTwoPathsAreTheSame_WhenCheckPathContains_ThenShouldBeTrue(string parentPath, string path, bool expectedResult) | ||
| { | ||
| Assert.AreEqual(expectedResult, FilesFolders.PathContains(parentPath, path, true)); | ||
| } | ||
| } | ||
| } | ||
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
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.
nice, this will be helpful because through out explorer there are dup code to add trailing slash.