test(processor): line-comment, string-protection, structure cases
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
func main() { println("hi") }
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
func main() { println("hi") }
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
const s = "a\"b"; // c
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
const s = "a\"b";
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
const u = "http://example.com"; // real
|
||||||
|
console.log("/* not */");
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
const u = "http://example.com";
|
||||||
|
console.log("/* not */");
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
local s = "-- not"
|
||||||
|
x = 1 -- real
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
local s = "-- not"
|
||||||
|
x = 1
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
x = 1
|
||||||
|
|
||||||
|
# gone
|
||||||
|
|
||||||
|
y = 2
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
x = 1
|
||||||
|
|
||||||
|
|
||||||
|
y = 2
|
||||||
@@ -92,6 +92,11 @@ func TestWholeFile(t *testing.T) {
|
|||||||
cases := []wholeFileCase{
|
cases := []wholeFileCase{
|
||||||
{name: "python comment-only line removed", file: "py_comment_only.py"},
|
{name: "python comment-only line removed", file: "py_comment_only.py"},
|
||||||
{name: "python inline comment stripped", file: "py_inline.py"},
|
{name: "python inline comment stripped", file: "py_inline.py"},
|
||||||
|
{name: "comment marker inside string preserved", file: "js_string_marker.js"},
|
||||||
|
{name: "file with no comments is unchanged", file: "go_nocomment.go"},
|
||||||
|
{name: "intentional blank lines preserved", file: "py_blanks.py"},
|
||||||
|
{name: "escaped quote then line comment", file: "js_escaped.js"},
|
||||||
|
{name: "lua marker in string vs real comment", file: "lua_string.lua"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
|
|||||||
Reference in New Issue
Block a user