public void GlobPatternSetUnion() { { Assert.AreEqual("?b", GlobPatternSet.Union("ab", "cb")); Assert.AreEqual("**", GlobPatternSet.Union("a*", "**")); Assert.AreEqual("a**", GlobPatternSet.Union("a*", "a**")); Assert.AreEqual("*/*", GlobPatternSet.Union("abc/def", "*/*")); Assert.AreEqual("", GlobPatternSet.Union("", "")); Assert.AreEqual("", GlobPatternSet.Union("", "")); } }
public void GlobPatternSetIntersection() { { Assert.AreEqual("*/*", GlobPatternSet.Intersection("**", "*/*")); Assert.AreEqual("*?", GlobPatternSet.Intersection("**", "*?")); Assert.AreEqual("*a", GlobPatternSet.Intersection("**a", "*")); Assert.AreEqual("*/*/*.txt", GlobPatternSet.Intersection("**.txt", "*/*/*")); Assert.AreEqual(null, GlobPatternSet.Intersection("kissa", "koira")); Assert.AreEqual("kissa?", GlobPatternSet.Intersection("kissa*", "kissa?")); Assert.AreEqual("/home/user/*.zip/*.txt", GlobPatternSet.Intersection("/*/user/*.zip/*.txt", "/home/**")); Assert.AreEqual("", GlobPatternSet.Intersection("", "")); } }