From 565751db4e5b8370c0a05d1998a91e6e20a19bb4 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 24 Jan 2018 01:59:13 +0100 Subject: remove context --- core_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core_test.go') diff --git a/core_test.go b/core_test.go index be0773e..68229be 100644 --- a/core_test.go +++ b/core_test.go @@ -27,6 +27,12 @@ func cmp(t *testing.T, got, want Core) { } } +type mocConsole struct{} + +func (m *mocConsole) Read() uint16 { return 0 } +func (m *mocConsole) Write(uint16) {} +func (m *mocConsole) Len() uint16 { return 0 } + func TestEval(t *testing.T) { testCases := []struct { ins []Instruction @@ -112,7 +118,7 @@ func TestEval(t *testing.T) { for _, tc := range testCases { t.Run(fmt.Sprint(tc.ins), func(t *testing.T) { - state := New() + state := New(&mocConsole{}) for _, ins := range tc.ins { state.Eval(ins) } @@ -160,7 +166,7 @@ func TestNextST0(t *testing.T) { func TestLoadBytes(t *testing.T) { data := []byte{1, 2, 4, 8} - j1 := New() + j1 := New(&mocConsole{}) if err := j1.LoadBytes(data); err != nil { t.Fatal(err) } -- cgit v1.2.3