public void 通常() { var token = new MathObjectFactory("F").Create().TestSingle(); token.IsMathToken("F"); token.ToTokenString().TestString("F"); token.OriginalText.Is("F"); var math = CreateSingleSequence("Fg"); math.List.Count.Is(2); math.List[0].IsMathToken("F"); math.List[1].IsMathToken("g"); math.Sup.IsNull(); math.Sub.IsNull(); math.Main.TestString("Fg"); math.ToTokenString().TestString("Fg"); math = CreateSingleSequence("abcdefg"); math.List.Count.Is(7); math.List[0].IsMathToken("a"); math.List[1].IsMathToken("b"); math.List[2].IsMathToken("c"); math.List[3].IsMathToken("d"); math.List[4].IsMathToken("e"); math.List[5].IsMathToken("f"); math.List[6].IsMathToken("g"); math.Sup.IsNull(); math.Sub.IsNull(); math.Main.TestString("abcdefg"); math.ToTokenString().TestString("abcdefg"); math.OriginalText.Is("abcdefg"); }
public void 空() { var math = new MathObjectFactory("").CreateSingle(); math.OriginalText.Is(""); math.AsMathSequence().List.Count.Is(0); math.Main.TestString(""); math.ToTokenString().TestString(""); math = new MathObjectFactory("{}").CreateSingle(); math.OriginalText.Is("{}"); math.AsMathSequence().List.Count.Is(0); math.Main.TestString(""); math.AsMathSequence().LeftBracket.TestToken("{"); math.AsMathSequence().RightBracket.TestToken("}"); math.ToTokenString().TestString("{}"); math = new MathObjectFactory("{}^i").CreateSingle(); math.OriginalText.Is("{}^i"); math.AsMathSequence().List.Count.Is(0); math.Main.TestString(""); math.AsMathSequence().LeftBracket.TestToken("{"); math.AsMathSequence().RightBracket.TestToken("}"); math.AsMathSequence().Sup.IsMathToken("i"); math.AsMathSequence().Sub.IsNull(); math.ToTokenString().TestString("{}^i"); math = new MathObjectFactory("{}_j").CreateSingle(); math.OriginalText.Is("{}_j"); math.AsMathSequence().List.Count.Is(0); math.Main.TestString(""); math.AsMathSequence().LeftBracket.TestToken("{"); math.AsMathSequence().RightBracket.TestToken("}"); math.AsMathSequence().Sup.IsNull(); math.AsMathSequence().Sub.IsMathToken("j"); math.ToTokenString().TestString("{}_j"); math = new MathObjectFactory("{}^i_j").CreateSingle(); math.OriginalText.Is("{}^i_j"); math.AsMathSequence().List.Count.Is(0); math.Main.TestString(""); math.AsMathSequence().LeftBracket.TestToken("{"); math.AsMathSequence().RightBracket.TestToken("}"); math.AsMathSequence().Sup.IsMathToken("i"); math.AsMathSequence().Sub.IsMathToken("j"); math.ToTokenString().TestString("{}^i_j"); }
public void TeXコマンド() { var token = new MathObjectFactory(@"\theta").Create().TestSingle(); token.IsMathToken(@"\theta"); token.ToTokenString().TestString(@"\theta"); token.OriginalText.Is(@"\theta"); var math = CreateSingleSequence(@"F\theta"); math.List.Count.Is(2); math.List[0].IsMathToken("F"); math.List[1].IsMathToken(@"\theta"); math.Main.TestString(@"F\theta"); math.ToTokenString().TestString(@"F\theta"); math.OriginalText.Is(@"F\theta"); math = CreateSingleSequence(@"\cat{C}"); math.List.Count.Is(2); math.List[0].IsMathToken(@"\cat"); math.List[1].AsMathSequence().List.Count.Is(1); math.List[1].AsMathSequence().List[0].IsMathToken("C"); math.List[1].AsMathSequence().LeftBracket.TestToken("{"); math.List[1].AsMathSequence().RightBracket.TestToken("}"); math.List[1].ToTokenString().TestString("{C}"); math.Main.TestString(@"\cat{C}"); math.ToTokenString().TestString(@"\cat{C}"); math.OriginalText.Is(@"\cat{C}"); math = CreateSingleSequence(@"\encat{C}\otimes\encat{D}"); math.List.Count.Is(5); math.List[0].IsMathToken("\\encat"); math.List[1].AsMathSequence().List.Count.Is(1); math.List[1].AsMathSequence().List[0].IsMathToken("C"); math.List[1].AsMathSequence().LeftBracket.TestToken("{"); math.List[1].AsMathSequence().RightBracket.TestToken("}"); math.List[2].IsMathToken("\\otimes"); math.List[3].IsMathToken("\\encat"); math.List[4].AsMathSequence().List.Count.Is(1); math.List[4].AsMathSequence().List[0].IsMathToken("D"); math.List[4].AsMathSequence().LeftBracket.TestToken("{"); math.List[4].AsMathSequence().RightBracket.TestToken("}"); math.Main.TestString(@"\encat{C}\otimes\encat{D}"); math.ToTokenString().TestString(@"\encat{C}\otimes\encat{D}"); math.OriginalText.Is(@"\encat{C}\otimes\encat{D}"); }