diff options
| author | Shulhan <ms@kilabit.info> | 2022-08-03 22:27:33 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-08-03 22:27:33 +0700 |
| commit | ec98ea095fa85b5a4b64bd7ad37414c30d14310e (patch) | |
| tree | a0d0af0ad27852b1644972ee2b11e870ea5acc03 /lib/strings/row_example_test.go | |
| parent | 39d9c20c35a11c44cdd27783e407c1225027d820 (diff) | |
| download | pakakeh.go-ec98ea095fa85b5a4b64bd7ad37414c30d14310e.tar.xz | |
lib/strings: clean up test codes
Changes,
* Use test.Data for test that require longer text input and output
* Replace variable declaration ":=" with explicit one.
* Use literal string
Diffstat (limited to 'lib/strings/row_example_test.go')
| -rw-r--r-- | lib/strings/row_example_test.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/strings/row_example_test.go b/lib/strings/row_example_test.go index 45292e94..0b4acfc0 100644 --- a/lib/strings/row_example_test.go +++ b/lib/strings/row_example_test.go @@ -9,12 +9,12 @@ import ( ) func ExampleRow_IsEqual() { - row := Row{{"a"}, {"b", "c"}} - fmt.Println(row.IsEqual(Row{{"a"}, {"b", "c"}})) - fmt.Println(row.IsEqual(Row{{"a"}, {"c", "b"}})) - fmt.Println(row.IsEqual(Row{{"c", "b"}, {"a"}})) - fmt.Println(row.IsEqual(Row{{"b", "c"}, {"a"}})) - fmt.Println(row.IsEqual(Row{{"a"}, {"b"}})) + var row = Row{{`a`}, {`b`, `c`}} + fmt.Println(row.IsEqual(Row{{`a`}, {`b`, `c`}})) + fmt.Println(row.IsEqual(Row{{`a`}, {`c`, `b`}})) + fmt.Println(row.IsEqual(Row{{`c`, `b`}, {`a`}})) + fmt.Println(row.IsEqual(Row{{`b`, `c`}, {`a`}})) + fmt.Println(row.IsEqual(Row{{`a`}, {`b`}})) // Output: // true // true @@ -24,11 +24,11 @@ func ExampleRow_IsEqual() { } func ExampleRow_Join() { - row := Row{{"a"}, {"b", "c"}} - fmt.Println(row.Join(";", ",")) + var row = Row{{`a`}, {`b`, `c`}} + fmt.Println(row.Join(`;`, `,`)) - row = Row{{"a"}, {}} - fmt.Println(row.Join(";", ",")) + row = Row{{`a`}, {}} + fmt.Println(row.Join(`;`, `,`)) // Output: // a;b,c // a; |
