| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../http/tests/inspector/inspector-test.js"></script> | |
| 4 | |
| 5 <script> | |
| 6 function test() | |
| 7 { | |
| 8 var testStrings = [ | |
| 9 {"odd back slashes with text around":"tes\\\"t"}, | |
| 10 {"escaped double quotes":"\"test\""}, | |
| 11 {"escaped back slash before double quote":"test\\"}, | |
| 12 {1:2}, | |
| 13 {"":""}, | |
| 14 {"nested brackets":{}}, | |
| 15 {"nested brackets with double quotes":{"":""}}, | |
| 16 {"etc":{"\\":"\""}}, | |
| 17 {"etc":{"\\\\":"\\"}}, | |
| 18 {"etc":{"\\\\\"":"\\\\\""}}, | |
| 19 ]; | |
| 20 | |
| 21 for (var i = 0; i < testStrings.length; ++i) { | |
| 22 var string = JSON.stringify(testStrings[i]); | |
| 23 var index = WebInspector.TextUtils.findBalancedCurlyBrackets(string); | |
| 24 InspectorTest.addResult((string === string.slice(0, index) ? "PASS: " :
"FAIL: ") + " '" + string + "'"); | |
| 25 } | |
| 26 InspectorTest.completeTest(); | |
| 27 } | |
| 28 </script> | |
| 29 | |
| 30 <body onload="runTest()"> | |
| 31 Test that WebInspector.TextUtils.findBalancedCurlyBrackets correctly matches cur
ly brackets and double quotes. | |
| 32 </p> | |
| 33 </body> | |
| 34 </html> | |
| OLD | NEW |