Ejemplo n.º 1
0
        public void ePrematureEOF_Thrown()
        {
          var src = @"";

          var lxr = new JL(new StringSource(src));
          lxr.AnalyzeAll();
        }
Ejemplo n.º 2
0
        public void eUnterminatedString3_Verbatim()
        {
            var src = @"a: $""aa
          
          aa";

            var lxr = new JL(new StringSource(src));

            lxr.AnalyzeAll();
        }
Ejemplo n.º 3
0
        public void eUnterminatedComment2()
        {
            var src = @"a: |*aa
          
          aa";

            var lxr = new JL(new StringSource(src));

            lxr.AnalyzeAll();
        }
Ejemplo n.º 4
0
        public void ePrematureEOF_CouldLogButThrown()
        {
          var src = @"";

          var msgs = new MessageList();

          var lxr = new JL(new StringSource(src), msgs, throwErrors: true);
          lxr.AnalyzeAll();

          Assert.IsNotNull(msgs.FirstOrDefault(m => m.Type == MessageType.Error && m.Code == (int)JSONMsgCode.ePrematureEOF));
        }
Ejemplo n.º 5
0
        public void ePrematureEOF_CouldLogButThrown()
        {
            var src = @"";

            var msgs = new MessageList();

            var lxr = new JL(new StringSource(src), msgs, throwErrors: true);

            lxr.AnalyzeAll();

            Assert.IsNotNull(msgs.FirstOrDefault(m => m.Type == MessageType.Error && m.Code == (int)JSONMsgCode.ePrematureEOF));
        }
Ejemplo n.º 6
0
        public void Comments12withStrings()
        {
            //string is opened but line break
            var src = @"{       
          '|* /* //comment text " + "\n\r" + @" */ *|'
          }
          ";

            var lxr = new JL(new StringSource(src));

            lxr.AnalyzeAll();
        }
Ejemplo n.º 7
0
        public void ePrematureEOF_Logged()
        {
            var src = @"";

            var msgs = new MessageList();

            var lxr = new JL(new StringSource(src), msgs);

            lxr.AnalyzeAll();

            Aver.IsNotNull(msgs.FirstOrDefault(m => m.Type == MessageType.Error && m.Code == (int)JSONMsgCode.ePrematureEOF));
        }
Ejemplo n.º 8
0
        public void eUnterminatedString4_Verbatim()
        {
          var src = @"a: $'aa
          
          aa";

          var lxr = new JL(new StringSource(src));
          lxr.AnalyzeAll();
        }
Ejemplo n.º 9
0
        public void eUnterminatedString2()
        {
          var src = @"a: ""aaaa";

          var lxr = new JL(new StringSource(src));
          lxr.AnalyzeAll();
        }
Ejemplo n.º 10
0
        public void eUnterminatedComment1()
        {
          var src = @"a: /*aa
          
          aa";

          var lxr = new JL(new StringSource(src));
          lxr.AnalyzeAll();
        }
Ejemplo n.º 11
0
        public void Comments12withStrings()
        {
          //string is opened but line break
          var src = @"{       
          '|* /* //comment text "+"\n\r"+@" */ *|'
          }
          ";

          var lxr = new JL(new StringSource(src));

          lxr.AnalyzeAll();
        }