aboutsummaryrefslogtreecommitdiff
path: root/lib/test/test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-05-30 22:29:07 +0700
committerShulhan <ms@kilabit.info>2023-05-30 23:34:53 +0700
commitb2619cda05c46175dc4f2e0ae7efbd3dae8b574b (patch)
tree23c82ffa10010b5dcd174ba3f328b1020f26756d /lib/test/test.go
parent0a2f635da27777bdbb96101cc84be3790b46059a (diff)
downloadpakakeh.go-b2619cda05c46175dc4f2e0ae7efbd3dae8b574b.tar.xz
lib/test: update documentation related to Assert and Data
The documentation is based on the article published at https://kilabit.local/journal/2023/go_test_data/ after reviewing and explain how to use both of them to public.
Diffstat (limited to 'lib/test/test.go')
-rw-r--r--lib/test/test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/test/test.go b/lib/test/test.go
index 226e3471..734c7e20 100644
--- a/lib/test/test.go
+++ b/lib/test/test.go
@@ -61,7 +61,7 @@ func printStackTrace(w Writer, trace []byte) {
// will use the [diff.Text] to show the difference between them.
// The diff output is as follow,
//
-// !!! "string not matched" / <desc>:
+// !!! <name>:
// ---- EXPECTED
// <LINE_NUM> - "<STRING>"
// ...
@@ -72,9 +72,11 @@ func printStackTrace(w Writer, trace []byte) {
// <LINE_NUM> - "<LINE_EXP>"
// <LINE_NUM> + "<LINE_GOT>"
//
-// Any lines after "----" indicate the lines that test expected.
+// Any lines after "----" indicate the lines that test expected, from `exp`
+// parameter.
//
-// Any lines after "++++" indicate the lines that test got.
+// Any lines after "++++" indicate the lines that test got, from `got`
+// parameter.
//
// Any lines after "--++" indicate that the same line between expected and got
// but different content.