Minor fuckings

This commit is contained in:
2025-03-22 04:13:13 +01:00
parent 012c49d4f7
commit b96b6f9ef1
2 changed files with 19 additions and 19 deletions

View File

@@ -35,7 +35,7 @@ func TestSimpleValueMultiplication(t *testing.T) {
luaExpr := `*1.5`
luaScript := buildLuaScript(luaExpr)
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -68,7 +68,7 @@ func TestShorthandNotation(t *testing.T) {
luaExpr := `v1 * 1.5` // Use direct assignment syntax
luaScript := buildLuaScript(luaExpr)
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr )
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -100,7 +100,7 @@ func TestArrayNotation(t *testing.T) {
luaExpr := `v1 = v1 * 1.5` // Use direct assignment syntax
luaScript := buildLuaScript(luaExpr)
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -140,7 +140,7 @@ func TestMultipleMatches(t *testing.T) {
luaExpr := `*1.5`
luaScript := buildLuaScript(luaExpr)
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -182,7 +182,7 @@ func TestMultipleCaptureGroups(t *testing.T) {
}
t.Logf("Matches: %v", matches)
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -225,7 +225,7 @@ func TestModifyingMultipleValues(t *testing.T) {
}
t.Logf("Matches: %v", matches)
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -259,7 +259,7 @@ func TestDecimalValues(t *testing.T) {
luaExpr := `v1 = v1 * v2` // Use direct assignment syntax
luaScript := buildLuaScript(luaExpr)
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr )
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -291,7 +291,7 @@ func TestLuaMathFunctions(t *testing.T) {
luaExpr := `v1 = math.sqrt(v1)` // Use direct assignment syntax
luaScript := buildLuaScript(luaExpr)
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -325,7 +325,7 @@ func TestDirectAssignment(t *testing.T) {
t.Logf("Lua script: %s", luaScript) // Log the generated script for debugging
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -415,7 +415,7 @@ func TestProcessingSampleFiles(t *testing.T) {
t.Logf("Lua expression: %s", tc.luaExpr)
// Process the content
modifiedContent, err := process(tc.fileContent, regex, luaScript)
modifiedContent, _, _, err := process(tc.fileContent, regex, luaScript, "test.xml", tc.luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -465,7 +465,7 @@ func TestFileOperations(t *testing.T) {
t.Logf("Lua expression: %s", luaExpr)
// Process the content
modifiedContent, err := process(fileContent, regex, luaScript)
modifiedContent, _, _, err := process(fileContent, regex, luaScript, "test.xml", luaExpr )
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -502,7 +502,7 @@ func TestFileOperations(t *testing.T) {
t.Logf("Lua expression: %s", luaExpr)
// Process the content
modifiedContent, err := process(fileContent, regex, luaScript)
modifiedContent, _, _, err := process(fileContent, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -537,7 +537,7 @@ func TestFileOperations(t *testing.T) {
t.Logf("Lua expression: %s", luaExpr)
// Process the content
modifiedContent, err := process(fileContent, regex, luaScript)
modifiedContent, _, _, err := process(fileContent, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -574,7 +574,7 @@ func TestHigherVariableIndices(t *testing.T) {
// Expected: 10 + 20 * 30 / 40 - 50 = 10 + 15 - 50 = -25
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing with v3-v5: %v", err)
}
@@ -594,7 +594,7 @@ func TestHigherVariableIndices(t *testing.T) {
// Expected: 10 * 110 = 1100
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing with v11: %v", err)
}
@@ -613,7 +613,7 @@ func TestHigherVariableIndices(t *testing.T) {
luaScript := buildLuaScript(luaExpr)
// This should double the value
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing with v0: %v", err)
}
@@ -649,7 +649,7 @@ func TestMultiStatementExpression(t *testing.T) {
t.Logf("Generated Lua script: %s", luaScript)
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}
@@ -698,7 +698,7 @@ end
t.Logf("Generated Lua script: %s", luaScript)
modifiedContent, err := process(fileContents, regex, luaScript)
modifiedContent, _, _, err := process(fileContents, regex, luaScript, "test.xml", luaExpr)
if err != nil {
t.Fatalf("Error processing file: %v", err)
}