go fix my shit
All checks were successful
/ test (push) Successful in 51s

This commit is contained in:
Neemek 2026-09-23 09:13:28 +02:00
parent 0db420aae4
commit 7245af0438
Signed by: neemek
GPG key ID: 433EA4A50D4F55A3
5 changed files with 35 additions and 30 deletions

View file

@ -2,18 +2,19 @@ package core
import (
"fmt"
"slices"
"testing"
)
func CompareScope(t *testing.T, expectedScope []map[string]Value, actualScope *Scope) {
s := actualScope
for i := len(expectedScope) - 1; i >= 0; i-- {
for _, e := range slices.Backward(expectedScope) {
if s == nil {
t.Fatal("scope cut unexpecetantly short")
}
for name, value := range expectedScope[i] {
for name, value := range e {
v, ok := s.current[name]
if !ok {
t.Errorf("variable %s not found in correct scope", name)