aboutsummaryrefslogtreecommitdiffstats
path: root/common/loc/loc_test.go
blob: 5b68cc8bac8dcd3a08381deefc467e589f457d91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)
	}
}