diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-06 23:32:10 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-06 23:32:10 +1000 |
commit | 666ea93dba377f267a2c8ecf97378a420db18383 (patch) | |
tree | 5efee0b6e4ccf44b854d9bb65e4e6fa5e7f86548 /pointer_test.go | |
parent | 9d7779e8ca5404f26abbd8cce0314d9cee967bba (diff) |
Eliminate a bunch of allocations
Diffstat (limited to 'pointer_test.go')
-rw-r--r-- | pointer_test.go | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/pointer_test.go b/pointer_test.go deleted file mode 100644 index 6b432f0..0000000 --- a/pointer_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package parsec - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestPointer(t *testing.T) { - p := Pointer{"fooo", 0} - - t.Run("Advances", func(t *testing.T) { - p2 := p.Advance(2) - require.Equal(t, Pointer{"fooo", 2}, p2) - require.Equal(t, Pointer{"fooo", 0}, p) - require.Equal(t, Pointer{"fooo", 3}, p2.Advance(1)) - }) - - t.Run("Get", func(t *testing.T) { - require.Equal(t, "fooo", p.Get()) - require.Equal(t, "ooo", p.Advance(1).Get()) - require.Equal(t, "", p.Advance(4).Get()) - require.Equal(t, "", p.Advance(10).Get()) - }) -} |