nswrap/ast/util_test.go
2019-06-11 12:38:22 -04:00

24 lines
550 B
Go

package ast
import (
"testing"
)
func TestRemoveQuotes(t *testing.T) {
t.Run("RemoveQuotes1", func(t *testing.T) {
if removeQuotes(`''`) != "" {
t.Errorf("Empty single quoted string test failed\n")
}
})
t.Run("RemoveQuotes2", func(t *testing.T) {
if removeQuotes(`"hi there"`) != `hi there` {
t.Errorf("Double quoted string test failed: %s -> %s\n", `"hi there"`, removeQuotes(`"hi there"`))
}
})
t.Run("TypesTree", func(t *testing.T) {
if typesTree(nil, 0) != "" {
t.Errorf(`typesTree(nil,0) did not return ""`)
}
})
}