Skip to content

Commit d9c05a9

Browse files
committed
- [+] add more test coverage cases
1 parent 6d0c470 commit d9c05a9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

egVar/EgVar_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ func ExampleEgVar_output() {
4545
easygen.Process0(tmpl, os.Stdout,
4646
"{{clk2lc .Name}} {{clk2uc .Name}} =>\n", "../test/listfunc2")
4747
easygen.Process0(tmpl, os.Stdout,
48-
"{{clk2lc .Name}}: {{clk2lc .Name | clk2uc}} {{clk2lc .Name | clc2ls}} {{clk2lc .Name | clc2ss}}\n", "../test/listfunc2")
48+
"{{clk2lc .Name}}: {{clk2lc .Name | clc2uc}} {{clk2lc .Name | clc2ls}} {{clk2lc .Name | clc2ss}}\n", "../test/listfunc2")
4949
easygen.Process0(tmpl, os.Stdout,
5050
"{{clk2uc .Name}}: {{clk2uc .Name | cuc2lc}} {{clk2uc .Name | cuc2ls}} {{clk2uc .Name | cuc2ss}}\n", "../test/listfunc2")
5151
easygen.Process0(tmpl, os.Stdout,
52-
"{{.NameMixed}}: {{clc2uc .NameMixed}} {{clc2uc .NameMixed | cuc2lc}}\n", "../test/listfunc2")
52+
"{{.NameMixed}}: {{clc2uc .NameMixed}} {{clc2uc .NameMixed | cuc2lc}} {{clc2ls .NameMixed}} {{clc2ls .NameMixed | cls2lc}}\n", "../test/listfunc2")
53+
easygen.Process0(tmpl, os.Stdout,
54+
"{{.NameMixed}}: {{clc2ls .NameMixed | cls2ss}} {{clc2ls .NameMixed | cls2lk}} {{clc2ls .NameMixed | cls2hh}}\n", "../test/listfunc2")
5355

5456
// Output:
5557
//
@@ -74,6 +76,7 @@ func ExampleEgVar_output() {
7476
// someInitMethod SomeInitMethod =>
7577
// someInitMethod: SomeInitMethod some_init_method SOME_INIT_METHOD
7678
// SomeInitMethod: someInitMethod some_init_method SOME_INIT_METHOD
77-
// some_InitMethod: Some_InitMethod some_InitMethod
79+
// some_InitMethod: Some_InitMethod some_InitMethod some__init_method someInitMethod
80+
// some_InitMethod: SOME__INIT_METHOD some--init-method Some--Init-Method
7881

7982
}

egVar/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
// for standalone test, change package to `main` and the next func def to,
1111
// func main() {
12-
func Example_output() {
12+
func Example() {
1313
// Equivalent testing on commandline:
1414
// easygen test/listfunc2
1515

0 commit comments

Comments
 (0)