From bfa79cf52d62418f622289cee7c1fe5807c73be6 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 12 Apr 2026 17:38:32 +0700 Subject: text/diff: add example for Files, Lines, Text, and Unified While at it, - reorganize the order of functions alphabetically, following the order from doc. - changes the [Line.String] to print text in double quoted to help human compare the changes for non-printable characters. --- lib/text/diff/testdata/lao.txt | 11 +++++++++++ lib/text/diff/testdata/tzu.txt | 13 +++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 lib/text/diff/testdata/lao.txt create mode 100644 lib/text/diff/testdata/tzu.txt (limited to 'lib/text/diff/testdata') diff --git a/lib/text/diff/testdata/lao.txt b/lib/text/diff/testdata/lao.txt new file mode 100644 index 00000000..635ef2c4 --- /dev/null +++ b/lib/text/diff/testdata/lao.txt @@ -0,0 +1,11 @@ +The Way that can be told of is not the eternal Way; +The name that can be named is not the eternal name. +The Nameless is the origin of Heaven and Earth; +The Named is the mother of all things. +Therefore let there always be non-being, + so we may see their subtlety, +And let there always be being, + so we may see their outcome. +The two are the same, +But after they are produced, + they have different names. diff --git a/lib/text/diff/testdata/tzu.txt b/lib/text/diff/testdata/tzu.txt new file mode 100644 index 00000000..5af88a8f --- /dev/null +++ b/lib/text/diff/testdata/tzu.txt @@ -0,0 +1,13 @@ +The Nameless is the origin of Heaven and Earth; +The named is the mother of all things. + +Therefore let there always be non-being, + so we may see their subtlety, +And let there always be being, + so we may see their outcome. +The two are the same, +But after they are produced, + they have different names. +They both may be called deep and profound. +Deeper and more profound, +The door of all subtleties! -- cgit v1.3-6-g1900