forked from dshills/goauto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
transformer_test.go
46 lines (37 loc) · 896 Bytes
/
transformer_test.go
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2015 Davin Hills. All rights reserved.
// MIT license. License details can be found in the LICENSE file.
package goauto
import "testing"
func TestTransforms(t *testing.T) {
var e, i, o string
i = "TRANSFORM"
o = Identity(i)
if i != o {
t.Errorf("Expected %v got %v", i, o)
}
/* Only works local, obviously
i = "/Users/dshills/Development/Go/src/github.com/dshills/goauto/transform.go"
e = "src/github.com/dshills/goauto/transform.go"
o = GoRelBase(i)
if o != e {
t.Errorf("Expected %v got %v", e, o)
}
o = GoRelDir(i)
e = "src/github.com/dshills/goauto"
if o != e {
t.Errorf("Expected %v got %v", e, o)
}
o = GoRelSrcDir(i)
e = "github.com/dshills/goauto"
if o != e {
t.Errorf("Expected %v got %v", e, o)
}
*/
i = "transform.go"
fx := ExtTransformer("js")
o = fx(i)
e = "transform.js"
if o != e {
t.Errorf("Expected %v got %v", e, o)
}
}