public void U4EscapeSequenceIsExtracted() { String input = "\"" + @"some\uABCDstring" + "\""; var parser = new RStringScanner(input); Assert.Equal(new StringPart(5,6), parser.Next()); Assert.Equal(null, parser.Next()); }
public void EscapeInSingleQuotesIsExtracted() { String input = @"'some\rstring'"; var parser = new RStringScanner(input); Assert.Equal(new StringPart(5,2), parser.Next()); Assert.Equal(null, parser.Next()); }
public void EscapedBackslashIsExtractedCorrectly() { String input = "\"" + @"some\\string" + "\""; var parser = new RStringScanner(input); Assert.Equal(new StringPart(5,2), parser.Next()); Assert.Equal(null, parser.Next()); }
public void TwoSeparateEscapeSequencesAreExtracted() { String input = "\"" + @"some\rother\nstring" + "\""; var parser = new RStringScanner(input); Assert.Equal(new StringPart(5,2), parser.Next()); Assert.Equal(new StringPart(12,2), parser.Next()); Assert.Equal(null, parser.Next()); }
public void NoEscapesReturnsNull() { String input = "\"some string\""; var parser = new RStringScanner(input); Assert.Equal(null, parser.Next()); }
public void UpperUBracesEscapeSequenceIsExtracted() { String input = "\"" + @"some\U{A12}string" + "\""; var parser = new RStringScanner(input); Assert.Equal(new StringPart(5,7), parser.Next()); Assert.Equal(null, parser.Next()); }