public void RegularExpressionLiteralsAreCorrectlyEncoded()
 {
     AssertCorrect(JsExpression.Regexp("x"), "/x/");
     AssertCorrect(JsExpression.Regexp("\""), "/\"/");
     AssertCorrect(JsExpression.Regexp("/"), "/\\//");
     AssertCorrect(JsExpression.Regexp("\r\n/\\"), "/\\r\\n\\/\\\\/");
     AssertCorrect(JsExpression.Regexp("x", "g"), "/x/g");
 }
Exemple #2
0
 public void RegularExpressionLiteralsAreCorrectlyEncoded()
 {
     AssertCorrect(JsExpression.Regexp("x"), "/x/");
     AssertCorrect(JsExpression.Regexp("\""), "/\"/");
     AssertCorrect(JsExpression.Regexp("/"), "/\\//");
     AssertCorrect(JsExpression.Regexp("'"), "/'/");
     AssertCorrect(JsExpression.Regexp("\""), "/\"/");
     AssertCorrect(JsExpression.Regexp("x", "g"), "/x/g");
     AssertCorrect(JsExpression.Regexp(@"\s \\ x"), @"/\s \\ x/");
 }