public void Equal() { Pattern Alternator = (Pattern)"Hello" | "Goodbye"; Assert.IsTrue(Alternator.Equals("Hello")); Assert.IsTrue(Alternator.Equals("Goodbye")); Assert.IsFalse(Alternator.Equals("World")); }
public void Equal() { Pattern Negator = !(Pattern)"Hello"; Assert.IsTrue(Negator.Equals("World")); Assert.IsTrue(Negator.Equals("Hello ")); Assert.IsFalse(Negator.Equals("Hello")); }
public void CharCheckerEqual() { Pattern CharChecker = (Pattern)(nameof(CharChecker), (Char) => Char == 'a' || Char == '1'); Assert.IsTrue(CharChecker.Equals("a")); Assert.IsTrue(CharChecker.Equals("1")); Assert.IsFalse(CharChecker.Equals("b")); Assert.IsFalse(CharChecker.Equals("a1")); }
public void Equal() { Pattern Repeater = (Pattern)"Hi!" * 2; Assert.IsTrue(Repeater.Equals("Hi!Hi!")); Assert.IsFalse(Repeater.Equals("Hi!")); Assert.IsFalse(Repeater.Equals("Hi!Ho.")); Assert.IsFalse(Repeater.Equals("Hi!Hi!Hi!")); }
public void Equal() { Pattern Hello = "Hello"; Pattern Space = ' '; Pattern World = "World"; Assert.IsTrue(Hello.Equals("Hello")); Assert.IsFalse(Hello.Equals("Hello ")); Assert.IsFalse(Hello.Equals("Hell")); Assert.IsFalse(Hello.Equals("World")); Assert.IsTrue(Space.Equals(" ")); Assert.IsFalse(Space.Equals(" ")); Assert.IsFalse(Space.Equals("a")); Pattern HelloWorld = Hello & Space & World; //This isn't a normal concatenator, but rather, should be optimized into a single StringLiteral Assert.IsTrue(HelloWorld.Equals("Hello World")); Assert.IsFalse(HelloWorld.Equals("Hello")); Assert.IsFalse(HelloWorld.Equals("Hello Bacon")); }
public void Equal() { Pattern AB = +(Pattern)"AB"; Assert.IsFalse(AB.Equals("")); Assert.IsFalse(AB.Equals("A")); Assert.IsTrue(AB.Equals("AB")); Assert.IsFalse(AB.Equals("ABA")); Assert.IsTrue(AB.Equals("ABAB")); Assert.IsFalse(AB.Equals("ABABA")); Assert.IsFalse(AB.Equals("AAB")); Assert.IsFalse(AB.Equals("ABB")); }