コード例 #1
0
 public void TwoSeparateEscapeSequencesAreExtracted() {
   String input = "\"" + @"some\rother\nstring" + "\"";
   var parser = new BasicCStringScanner(input);
   Assert.Equal(new StringPart(5,2), parser.Next());
   Assert.Equal(new StringPart(12,2), parser.Next());
   Assert.Equal(null, parser.Next());
 }
コード例 #2
0
        public void U8EscapeSequenceIsExtracted()
        {
            String input  = "\"" + @"some\UABCD1234string" + "\"";
            var    parser = new BasicCStringScanner(input);

            Assert.Equal(new StringPart(5, 10), parser.Next());
            Assert.Equal(null, parser.Next());
        }
コード例 #3
0
        public void EscapeInSingleQuotesIsExtracted()
        {
            String input  = @"'some\rstring'";
            var    parser = new BasicCStringScanner(input);

            Assert.Equal(new StringPart(5, 2), parser.Next());
            Assert.Equal(null, parser.Next());
        }
コード例 #4
0
        public void EscapedBackslashIsExtractedCorrectly()
        {
            String input  = "\"" + @"some\\string" + "\"";
            var    parser = new BasicCStringScanner(input);

            Assert.Equal(new StringPart(5, 2), parser.Next());
            Assert.Equal(null, parser.Next());
        }
コード例 #5
0
        public void EscapeAtStartWithNoQuotesIsExtracted()
        {
            String input  = @"\rstring";
            var    parser = new BasicCStringScanner(input);

            Assert.Equal(new StringPart(0, 2), parser.Next());
            Assert.Equal(null, parser.Next());
        }
コード例 #6
0
        public void NoEscapesReturnsNull()
        {
            String input  = "\"some string\"";
            var    parser = new BasicCStringScanner(input);

            Assert.Equal(null, parser.Next());
        }
コード例 #7
0
 public void NoSequencesInAtStringAreExtracted() {
   String input = "@\"" + @"some\rother\nstring" + "\"";
   var parser = new BasicCStringScanner(input);
   Assert.Equal(null, parser.Next());
 }