aboutsummaryrefslogtreecommitdiffstats
path: root/common/loc/loc_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/loc/loc_test.go')
-rw-r--r--common/loc/loc_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/common/loc/loc_test.go b/common/loc/loc_test.go
new file mode 100644
index 0000000..5b68cc8
--- /dev/null
+++ b/common/loc/loc_test.go
@@ -0,0 +1,24 @@
+package loc
+
+import (
+ "testing"
+)
+
+func TestLoc(t *testing.T) {
+ dm3Loc := []byte(`-7040 -1856 -128 sng-mega
+1536 -1664 -1408 ra-tunnel
+11776 -7424 -192 ya
+12160 3456 -704 rl
+-5056 -5440 -128 sng-ra
+4096 6144 1728 lifts`)
+
+ loc, err := Parse(dm3Loc)
+ if err != nil {
+ t.Errorf("error when parsing loc data, %v", err)
+ }
+
+ l := loc.Get([3]float32{1300, -700, -24})
+ if l.Name != "ya" {
+ t.Errorf("expected to be at ya, got %v", l.Name)
+ }
+}