public void CompareDependsOnSymbolCompare() { Symbol sym1 = Symbol.intern("abc"); Symbol sym2 = Symbol.intern("a", "abc"); Symbol sym3 = Symbol.intern("b", "abc"); Keyword k1 = Keyword.intern(sym1); Keyword k2 = Keyword.intern(sym2); Keyword k3 = Keyword.intern(sym3); Expect(k1.CompareTo(k2), LessThan(0)); Expect(k2.CompareTo(k1), GreaterThan(0)); Expect(k1.CompareTo(k3), LessThan(0)); Expect(k3.CompareTo(k1), GreaterThan(0)); }
public void CompareToEqualKeywordIsZero() { Keyword k1 = Keyword.intern(Symbol.intern("abc")); Keyword k2 = Keyword.intern(Symbol.intern("abc")); Expect(k1.CompareTo(k2), EqualTo(0)); }
public void CompareToNonKeywordFails() { Symbol s1 = Symbol.intern("abc"); Keyword k1 = Keyword.intern(s1); k1.CompareTo(s1); }
/// <summary>Define ordering for templates</summary> public int CompareTo(Template?rhs) { return(Keyword.CompareTo(rhs?.Keyword)); }