diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2013-08-10 17:32:20 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2013-08-10 17:32:20 -0400 |
commit | b6e5189c4ece48e65633c3a3ee79981004acfa6e (patch) | |
tree | 5df6934877f1816ac740189d6fd1b13dd68e7314 /org.eclipse.jgit.test | |
parent | 594408e522f8823810eb27302d5314ba07bd1304 (diff) | |
parent | b3e9626743892fb33350264a86a0033d5a9756be (diff) | |
download | jgit-b6e5189c4ece48e65633c3a3ee79981004acfa6e.tar.gz jgit-b6e5189c4ece48e65633c3a3ee79981004acfa6e.zip |
Merge "Added characters to be escaped in file name patterns"
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/fnmatch/FileNameMatcherTest.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/fnmatch/FileNameMatcherTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/fnmatch/FileNameMatcherTest.java index ec0724406b..1db6c80304 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/fnmatch/FileNameMatcherTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/fnmatch/FileNameMatcherTest.java @@ -802,6 +802,46 @@ public class FileNameMatcherTest { } @Test + public void testEscapedBracket1() throws Exception { + assertMatch("\\[", "[", true, false); + } + + @Test + public void testEscapedBracket2() throws Exception { + assertMatch("\\[[a]", "[", false, true); + } + + @Test + public void testEscapedBracket3() throws Exception { + assertMatch("\\[[a]", "a", false, false); + } + + @Test + public void testEscapedBracket4() throws Exception { + assertMatch("\\[[a]", "[a", true, false); + } + + @Test + public void testEscapedBracket5() throws Exception { + assertMatch("[a\\]]", "]", true, false); + } + + @Test + public void testEscapedBracket6() throws Exception { + assertMatch("[a\\]]", "a", true, false); + } + + @Test + public void testEscapedBackslash() throws Exception { + assertMatch("a\\\\b", "a\\b", true, false); + } + + @Test + public void testMultipleEscapedCharacters1() throws Exception { + assertMatch("\\]a?c\\*\\[d\\?\\]", "]abc*[d?]", true, false); + } + + @Test public void testFilePathSimpleCase() throws Exception { assertFileNameMatch("a/b", "a/b", '/', true, false); } |