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