test(processor): line-comment, string-protection, structure cases

This commit is contained in:
2026-07-02 09:20:06 -05:00
parent f51fb3f170
commit d3ab6a41be
11 changed files with 30 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
package main
func main() { println("hi") }
+3
View File
@@ -0,0 +1,3 @@
package main
func main() { println("hi") }
+1
View File
@@ -0,0 +1 @@
const s = "a\"b"; // c
+1
View File
@@ -0,0 +1 @@
const s = "a\"b";
+2
View File
@@ -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
View File
@@ -0,0 +1,2 @@
local s = "-- not"
x = 1 -- real
+2
View File
@@ -0,0 +1,2 @@
local s = "-- not"
x = 1
+5
View File
@@ -0,0 +1,5 @@
x = 1
# gone
y = 2
+4
View File
@@ -0,0 +1,4 @@
x = 1
y = 2
+5
View File
@@ -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 {