aboutsummaryrefslogtreecommitdiff
path: root/lib/strings/row_example_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-08-03 22:27:33 +0700
committerShulhan <ms@kilabit.info>2022-08-03 22:27:33 +0700
commitec98ea095fa85b5a4b64bd7ad37414c30d14310e (patch)
treea0d0af0ad27852b1644972ee2b11e870ea5acc03 /lib/strings/row_example_test.go
parent39d9c20c35a11c44cdd27783e407c1225027d820 (diff)
downloadpakakeh.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.go20
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;