Fix overlapping capture groups

This commit is contained in:
2025-03-27 19:43:06 +01:00
parent 24262a7dca
commit dc8da8ab63
2 changed files with 43 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ package regression
import (
"modify/processor"
"os"
"path/filepath"
"testing"
)
@@ -83,13 +84,18 @@ func TestTalentsMechanicOutOfRange(t *testing.T) {
}
}
func TestIndexExplosions(t *testing.T) {
given, err := os.ReadFile("testfiles/OutpostItems.xml")
func TestIndexExplosions_ShouldNotPanic(t *testing.T) {
cwd, err := os.Getwd()
if err != nil {
t.Fatalf("Error getting current working directory: %v", err)
}
given, err := os.ReadFile(filepath.Join(cwd, "..", "testfiles", "OutpostItems.xml"))
if err != nil {
t.Fatalf("Error reading file: %v", err)
}
expected, err := os.ReadFile("testfiles/OutpostItemsExpected.xml")
expected, err := os.ReadFile(filepath.Join(cwd, "..", "testfiles", "OutpostItemsExpected.xml"))
if err != nil {
t.Fatalf("Error reading file: %v", err)
}