-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathmappings_test.go
More file actions
32 lines (30 loc) · 842 Bytes
/
mappings_test.go
File metadata and controls
32 lines (30 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package sourcemap
import (
"reflect"
"testing"
)
func TestParseMappings(t *testing.T) {
t.Parallel()
cases := map[string][]mapping{
";;;;;;kBAEe,YAAY,CAC1B,C;;AAHD": {
{genLine: 7, genColumn: 18, sourceLine: 3, sourceColumn: 15, namesInd: -1},
{genLine: 7, genColumn: 30, sourceLine: 3, sourceColumn: 27, namesInd: -1},
{genLine: 7, genColumn: 31, sourceLine: 4, sourceColumn: 1, namesInd: -1},
{genLine: 7, genColumn: 32, sourceLine: 4, sourceColumn: 1, namesInd: -1},
{genLine: 9, genColumn: 0, sourceLine: 1, sourceColumn: 0, namesInd: -1},
},
}
for k, c := range cases {
k, c := k, c
t.Run(k, func(t *testing.T) {
t.Parallel()
v, err := parseMappings(k)
if err != nil {
t.Fatalf("got error %s", err)
}
if !reflect.DeepEqual(v, c) {
t.Fatalf("expected %v got %v", c, v)
}
})
}
}