|
|
@@ -2,6 +2,7 @@ package gps
|
|
2
|
2
|
|
|
3
|
3
|
import (
|
|
4
|
4
|
"testing"
|
|
|
5
|
+ testex "juju.net.nz/testex"
|
|
5
|
6
|
)
|
|
6
|
7
|
|
|
7
|
8
|
func TestStrings(t *testing.T) {
|
|
|
@@ -38,3 +39,11 @@ func TestTime(t *testing.T) {
|
|
38
|
39
|
if p.GetTime(0) != expect { t.Error(); }
|
|
39
|
40
|
if p.Err != nil { t.Error(); }
|
|
40
|
41
|
}
|
|
|
42
|
+
|
|
|
43
|
+func TestLatLong(t *testing.T) {
|
|
|
44
|
+ p := &Parser{fields: []string{"4124.8963", "N"}}
|
|
|
45
|
+
|
|
|
46
|
+ expect := 41 + 24.8963/60
|
|
|
47
|
+ if !testex.Close(t, p.GetLatLong(0), expect) { t.Error(); }
|
|
|
48
|
+ if p.Err != nil { t.Error(); }
|
|
|
49
|
+}
|