* fix #1127 * fix #1127 * fixed unit test * add go keyword converter Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -64,3 +65,10 @@ func TestSafeString(t *testing.T) {
|
||||
assert.Equal(t, e.expected, SafeString(e.input))
|
||||
}
|
||||
}
|
||||
|
||||
func TestEscapeGoKeyword(t *testing.T) {
|
||||
for k := range goKeyword {
|
||||
assert.Equal(t, goKeyword[k], EscapeGolangKeyword(k))
|
||||
assert.False(t, isGolangKeyword(strings.Title(k)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user