Пример #1
0
        public void StringTest()
        {
            Assert.Equal(new MPJson(""), MPJson.Parse("\"\""));
            Assert.Equal(new MPJson("123"), MPJson.Parse("\"123\""));
            Assert.Equal(new MPJson("\""), MPJson.Parse(@"""\"""""));
            Assert.Equal(new MPJson("\b\f\t\r\n"), MPJson.Parse(@"""\b\f\t\r\n"""));

            Assert.Equal(new MPJson(""), MPJson.Parse("''"));
            Assert.Equal(new MPJson("123"), MPJson.Parse("'123'"));
            Assert.Equal(new MPJson("\\"), MPJson.Parse(@"'\\'"));
            Assert.Equal(new MPJson("/"), MPJson.Parse(@"'\/'"));
            Assert.Equal(new MPJson("\b\f\t\r\n"), MPJson.Parse(@"'\b\f\t\r\n'"));
            Assert.Equal(new MPJson("\u0041"), MPJson.Parse(@"'\u0041'"));
            Assert.Equal(new MPJson("\u000c"), MPJson.Parse(@"'\u000c'"));

            Assert.False(MPJson.TryParse("\"", out _));
        }