Began coding the interpreter (only manages the minimal example for now!)

This commit is contained in:
Julien Dessaux 2021-09-23 00:24:53 +02:00
parent 6f70a7237b
commit e3bc1251e8
4 changed files with 99 additions and 0 deletions

View file

@ -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)
}