add bracket syntax replace tests

This commit is contained in:
2025-08-24 23:25:43 -06:00
parent 4ac93ee924
commit e71b1c3a23
22 changed files with 3324 additions and 1673 deletions

View File

@ -0,0 +1,46 @@
package lang
// Basic comparison utilities for parser tests
// Helper functions for creating pointers
func stringPtr(s string) *string {
return &s
}
func intPtr(i int) *int {
return &i
}
// Pointer comparison functions
func stringPtrEqual(got, want *string) bool {
if (got == nil) != (want == nil) {
return false
}
if got != nil && want != nil {
return *got == *want
}
return true
}
func intPtrEqual(got, want *int) bool {
if (got == nil) != (want == nil) {
return false
}
if got != nil && want != nil {
return *got == *want
}
return true
}
// Slice comparison functions
func stringSliceEqual(got, want []string) bool {
if len(got) != len(want) {
return false
}
for i, s := range got {
if s != want[i] {
return false
}
}
return true
}