summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/pelletier/go-toml/position_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/pelletier/go-toml/position_test.go')
-rw-r--r--vendor/github.com/pelletier/go-toml/position_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/github.com/pelletier/go-toml/position_test.go b/vendor/github.com/pelletier/go-toml/position_test.go
new file mode 100644
index 000000000..63ad1afc8
--- /dev/null
+++ b/vendor/github.com/pelletier/go-toml/position_test.go
@@ -0,0 +1,29 @@
+// Testing support for go-toml
+
+package toml
+
+import (
+ "testing"
+)
+
+func TestPositionString(t *testing.T) {
+ p := Position{123, 456}
+ expected := "(123, 456)"
+ value := p.String()
+
+ if value != expected {
+ t.Errorf("Expected %v, got %v instead", expected, value)
+ }
+}
+
+func TestInvalid(t *testing.T) {
+ for i, v := range []Position{
+ {0, 1234},
+ {1234, 0},
+ {0, 0},
+ } {
+ if !v.Invalid() {
+ t.Errorf("Position at %v is valid: %v", i, v)
+ }
+ }
+}