Remove gotestyourself.

This commit is contained in:
Alec Thomas
2018-05-18 14:41:10 +10:00
parent c6776fe4b8
commit a41bb0e4da
2 changed files with 14 additions and 12 deletions
+2
View File
@@ -91,6 +91,8 @@ func (s *Scanner) Pop() Token {
} }
// PopValue token, or panic with Error. // PopValue token, or panic with Error.
//
// "context" is used to assist the user if the value can not be popped, eg. "expected <context> value but got <type>"
func (s *Scanner) PopValue(context string) string { func (s *Scanner) PopValue(context string) string {
t := s.Pop() t := s.Pop()
if !t.IsValue() { if !t.IsValue() {
+12 -12
View File
@@ -3,24 +3,24 @@ package kong
import ( import (
"testing" "testing"
"github.com/gotestyourself/gotestyourself/assert" "github.com/stretchr/testify/require"
) )
func TestScannerTake(t *testing.T) { func TestScannerTake(t *testing.T) {
s := Scan("a", "b", "c") s := Scan("a", "b", "c")
assert.Assert(t, s.Pop().Value == "a") require.Equal(t, s.Pop().Value, "a")
assert.Assert(t, s.Pop().Value == "b") require.Equal(t, s.Pop().Value, "b")
assert.Assert(t, s.Pop().Value == "c") require.Equal(t, s.Pop().Value, "c")
assert.Assert(t, s.Pop().Type == EOLToken) require.Equal(t, s.Pop().Type, EOLToken)
} }
func TestScannerPeek(t *testing.T) { func TestScannerPeek(t *testing.T) {
s := Scan("a", "b", "c") s := Scan("a", "b", "c")
assert.Assert(t, s.Peek().Value == "a") require.Equal(t, s.Peek().Value, "a")
assert.Assert(t, s.Pop().Value == "a") require.Equal(t, s.Pop().Value, "a")
assert.Assert(t, s.Peek().Value == "b") require.Equal(t, s.Peek().Value, "b")
assert.Assert(t, s.Pop().Value == "b") require.Equal(t, s.Pop().Value, "b")
assert.Assert(t, s.Peek().Value == "c") require.Equal(t, s.Peek().Value, "c")
assert.Assert(t, s.Pop().Value == "c") require.Equal(t, s.Pop().Value, "c")
assert.Assert(t, s.Peek().Type == EOLToken) require.Equal(t, s.Peek().Type, EOLToken)
} }