### Question:
SmartScriptLexer { public SmartScriptToken nextToken() { token = extractNextToken(); return getToken(); } SmartScriptLexer(String text); SmartScriptToken nextToken(); SmartScriptToken getToken(); void setState(SmartScriptLexerState state);  }### Answer:
@Test void testInvalidEscapingOutsideOfTags() { SmartScriptLexer lexer1 = new SmartScriptLexer("\\n"); assertThrows(SmartScriptLexerException.class, () -> lexer1.nextToken()); SmartScriptLexer lexer2 = new SmartScriptLexer("\\t"); assertThrows(SmartScriptLexerException.class, () -> lexer2.nextToken()); SmartScriptLexer lexer3 = new SmartScriptLexer("\\r"); assertThrows(SmartScriptLexerException.class, () -> lexer3.nextToken()); }
@Test void testValidEscapingOfBackslashOutsideOfTags() { SmartScriptLexer lexer = new SmartScriptLexer("\\\\"); assertEquals(new SmartScriptToken(SmartScriptTokenType.TEXT, "\\"), lexer.nextToken()); assertEquals(new SmartScriptToken(SmartScriptTokenType.EOF, null), lexer.nextToken()); assertThrows(SmartScriptLexerException.class, () -> lexer.nextToken()); }
@Test void testValidEscapingOfTagStartOutsideOfTags() { SmartScriptLexer lexer = new SmartScriptLexer("\\{"); assertEquals(new SmartScriptToken(SmartScriptTokenType.TEXT, "{"), lexer.nextToken()); assertEquals(new SmartScriptToken(SmartScriptTokenType.EOF, null), lexer.nextToken()); assertThrows(SmartScriptLexerException.class, () -> lexer.nextToken()); }