aboutsummaryrefslogtreecommitdiff
path: root/pkg/pointer/pointer_test.go
diff options
context:
space:
mode:
authorJulien Dessaux2021-09-23 00:24:53 +0200
committerJulien Dessaux2021-09-23 00:24:53 +0200
commite3bc1251e8cb20b30d0c5a27cd1da8f147a82de7 (patch)
treeffaaee42eedb2a380d45b6710f43a6c1350a080d /pkg/pointer/pointer_test.go
parentFixed test order mistake between expected value and got value (diff)
downloadgofunge98-e3bc1251e8cb20b30d0c5a27cd1da8f147a82de7.tar.gz
gofunge98-e3bc1251e8cb20b30d0c5a27cd1da8f147a82de7.tar.bz2
gofunge98-e3bc1251e8cb20b30d0c5a27cd1da8f147a82de7.zip
Began coding the interpreter (only manages the minimal example for now!)
Diffstat (limited to '')
-rw-r--r--pkg/pointer/pointer_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/pointer/pointer_test.go b/pkg/pointer/pointer_test.go
index 658528d..ccbf486 100644
--- a/pkg/pointer/pointer_test.go
+++ b/pkg/pointer/pointer_test.go
@@ -39,3 +39,14 @@ func TestStep(t *testing.T) { // Step is thoroughly tested in the field package
p.Step(*f)
require.Equal(t, defaultPointer, p)
}
+
+func TestGet(t *testing.T) {
+ // File of one char
+ file, err := os.Open("../field/test_data/minimal.b98")
+ require.NoError(t, err, "Failed to open file")
+ defer file.Close()
+ f, err := field.Load(file)
+ p := NewPointer()
+ v := p.Get(*f)
+ require.Equal(t, int('@'), v)
+}