Fix broken test introduced in previous commit

This commit is contained in:
2025-08-22 10:04:11 +02:00
parent d234616406
commit 5b46ff0efd
4 changed files with 62 additions and 40 deletions

View File

@@ -3,6 +3,8 @@ package processor
import (
"cook/utils"
"testing"
"github.com/google/go-cmp/cmp"
)
func TestSurgicalJSONEditing(t *testing.T) {
@@ -591,6 +593,7 @@ func TestRetardedJSONEditing(t *testing.T) {
for _, cmd := range commands {
result = result[:cmd.From] + cmd.With + result[cmd.To:]
}
// Check that the weight was changed
if result != expected {
@@ -777,9 +780,7 @@ func TestRetardedJSONEditing2(t *testing.T) {
],
"ParentTags": []
}
,"AdditionalStats": {
"(Value=\"BaseDeepMiningDrillSpeed_+%\")": 4000
}
,"AdditionalStats": {"(Value=\"BaseDeepMiningDrillSpeed_+%\")":4000}}
}
]
}
@@ -818,8 +819,9 @@ func TestRetardedJSONEditing2(t *testing.T) {
result = result[:cmd.From] + cmd.With + result[cmd.To:]
}
// Check that the weight was changed
if result != expected {
t.Errorf("Expected:\n%s\nGot:\n%s", expected, result)
}
diff := cmp.Diff(result, expected)
if diff != "" {
t.Errorf("Differences:\n%s", diff)
}
}