feat: add --output command in hrp build

This commit is contained in:
xucong053
2022-05-27 17:20:03 +08:00
parent 8fd093bdcc
commit c08861c9ca
6 changed files with 79 additions and 91 deletions
+16 -31
View File
@@ -7,38 +7,23 @@ import (
)
func TestRun(t *testing.T) {
err := Run([]string{"examples/debugtalk_no_funppy.py", "examples/debugtalk_no_fungo.go"})
err := Run("examples/debugtalk_no_funppy.py", "")
if !assert.Nil(t, err) {
t.Fatal()
}
err = Run("examples/debugtalk_no_fungo.go", "")
if !assert.Nil(t, err) {
t.Fatal()
}
err = Run("examples/debugtalk_no_funppy.py", "./debugtalk_gen.py")
if !assert.Nil(t, err) {
t.Fatal()
}
err = Run("examples/debugtalk_no_fungo.go", "./debugtalk_gen.bin")
if !assert.Nil(t, err) {
t.Fatal()
}
}
func TestConvertSnakeName(t *testing.T) {
testData := []struct {
expectedValue string
originalValue string
}{
{
expectedValue: "test_name",
originalValue: "testName",
},
{
expectedValue: "test",
originalValue: "test",
},
{
expectedValue: "test_name",
originalValue: "TestName",
},
{
expectedValue: "test_name",
originalValue: "test_name",
},
}
for _, data := range testData {
name := convertSnakeName(data.originalValue)
if !assert.Equal(t, data.expectedValue, name) {
t.Fatal()
}
}
}