aboutsummaryrefslogtreecommitdiff
path: root/lib/strings/row_example_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2018-09-17 00:26:46 +0700
committerShulhan <ms@kilabit.info>2018-09-17 22:51:23 +0700
commit66caeb368336e9f149d6f40772e7f0fdd070cf78 (patch)
treed0295d2fb895ce9e046400fae90cd7d69081c16a /lib/strings/row_example_test.go
parentf911fdc362d2a98a9f4deb93c18231ae77df12a1 (diff)
downloadpakakeh.go-66caeb368336e9f149d6f40772e7f0fdd070cf78.tar.xz
Merge package "github.com/shuLhan/tekstus", part 3/3
Diffstat (limited to 'lib/strings/row_example_test.go')
-rw-r--r--lib/strings/row_example_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/strings/row_example_test.go b/lib/strings/row_example_test.go
new file mode 100644
index 00000000..45292e94
--- /dev/null
+++ b/lib/strings/row_example_test.go
@@ -0,0 +1,35 @@
+// Copyright 2018, Shulhan <ms@kilabit.info>. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package strings
+
+import (
+ "fmt"
+)
+
+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"}}))
+ // Output:
+ // true
+ // true
+ // true
+ // true
+ // false
+}
+
+func ExampleRow_Join() {
+ row := Row{{"a"}, {"b", "c"}}
+ fmt.Println(row.Join(";", ","))
+
+ row = Row{{"a"}, {}}
+ fmt.Println(row.Join(";", ","))
+ // Output:
+ // a;b,c
+ // a;
+}