From 54d3d47daf9190275bbdaf8703b84969a4593451 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Fri, 24 Mar 2017 23:31:34 -0700 Subject: PLT-6076 Adding viper libs for config file changes (#5871) * Adding viper libs for config file changes * Removing the old fsnotify lib * updating some missing libs --- vendor/github.com/pelletier/go-toml/token_test.go | 67 +++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 vendor/github.com/pelletier/go-toml/token_test.go (limited to 'vendor/github.com/pelletier/go-toml/token_test.go') diff --git a/vendor/github.com/pelletier/go-toml/token_test.go b/vendor/github.com/pelletier/go-toml/token_test.go new file mode 100644 index 000000000..20b560d51 --- /dev/null +++ b/vendor/github.com/pelletier/go-toml/token_test.go @@ -0,0 +1,67 @@ +package toml + +import "testing" + +func TestTokenStringer(t *testing.T) { + var tests = []struct { + tt tokenType + expect string + }{ + {tokenError, "Error"}, + {tokenEOF, "EOF"}, + {tokenComment, "Comment"}, + {tokenKey, "Key"}, + {tokenString, "String"}, + {tokenInteger, "Integer"}, + {tokenTrue, "True"}, + {tokenFalse, "False"}, + {tokenFloat, "Float"}, + {tokenEqual, "="}, + {tokenLeftBracket, "["}, + {tokenRightBracket, "]"}, + {tokenLeftCurlyBrace, "{"}, + {tokenRightCurlyBrace, "}"}, + {tokenLeftParen, "("}, + {tokenRightParen, ")"}, + {tokenDoubleLeftBracket, "]]"}, + {tokenDoubleRightBracket, "[["}, + {tokenDate, "Date"}, + {tokenKeyGroup, "KeyGroup"}, + {tokenKeyGroupArray, "KeyGroupArray"}, + {tokenComma, ","}, + {tokenColon, ":"}, + {tokenDollar, "$"}, + {tokenStar, "*"}, + {tokenQuestion, "?"}, + {tokenDot, "."}, + {tokenDotDot, ".."}, + {tokenEOL, "EOL"}, + {tokenEOL + 1, "Unknown"}, + } + + for i, test := range tests { + got := test.tt.String() + if got != test.expect { + t.Errorf("[%d] invalid string of token type; got %q, expected %q", i, got, test.expect) + } + } +} + +func TestTokenString(t *testing.T) { + var tests = []struct { + tok token + expect string + }{ + {token{Position{1, 1}, tokenEOF, ""}, "EOF"}, + {token{Position{1, 1}, tokenError, "Δt"}, "Δt"}, + {token{Position{1, 1}, tokenString, "bar"}, `"bar"`}, + {token{Position{1, 1}, tokenString, "123456789012345"}, `"123456789012345"`}, + } + + for i, test := range tests { + got := test.tok.String() + if got != test.expect { + t.Errorf("[%d] invalid of string token; got %q, expected %q", i, got, test.expect) + } + } +} -- cgit v1.2.3-1-g7c22