From a6e6896309007fa1013bd51cee125ab8a75f282d Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 3 May 2025 19:41:19 -0300 Subject: re s/guuid/uuid/g --- tests/functional/string-round-trip/guuid.go | 62 ----------------------------- tests/functional/string-round-trip/uuid.go | 62 +++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 tests/functional/string-round-trip/guuid.go create mode 100644 tests/functional/string-round-trip/uuid.go (limited to 'tests/functional/string-round-trip') diff --git a/tests/functional/string-round-trip/guuid.go b/tests/functional/string-round-trip/guuid.go deleted file mode 100644 index 764576e..0000000 --- a/tests/functional/string-round-trip/guuid.go +++ /dev/null @@ -1,62 +0,0 @@ -package guuid - -import ( - "fmt" - "os" - "reflect" -) - - - -func showColour() bool { - return os.Getenv("NO_COLOUR") == "" -} - -func testing(message string, body func()) { - if showColour() { - fmt.Fprintf( - os.Stderr, - "\033[0;33mtesting\033[0m: %s... ", - message, - ) - body() - fmt.Fprintf(os.Stderr, "\033[0;32mOK\033[0m.\n") - } else { - fmt.Fprintf(os.Stderr, "testing: %s... ", message) - body() - fmt.Fprintf(os.Stderr, "OK.\n") - } -} - -func assertEq(given any, expected any) { - if !reflect.DeepEqual(given, expected) { - if showColour() { - fmt.Fprintf(os.Stderr, "\033[0;31mERR\033[0m.\n") - } else { - fmt.Fprintf(os.Stderr, "ERR.\n") - } - fmt.Fprintf(os.Stderr, "given != expected\n") - fmt.Fprintf(os.Stderr, "given: %#v\n", given) - fmt.Fprintf(os.Stderr, "expected: %#v\n", expected) - os.Exit(1) - } -} - - - -func MainTest() { - testing("string is the same after round-trip", func() { - str1 := New().String() - id, err := FromString(str1) - assertEq(err, nil) - str2 := id.String() - assertEq(str1, str2) - }) - - testing("UUID is the same after round-trip", func() { - id1 := New() - id2, err := FromString(id1.String()) - assertEq(err, nil) - assertEq(id1, id2) - }) -} diff --git a/tests/functional/string-round-trip/uuid.go b/tests/functional/string-round-trip/uuid.go new file mode 100644 index 0000000..000d3fb --- /dev/null +++ b/tests/functional/string-round-trip/uuid.go @@ -0,0 +1,62 @@ +package uuid + +import ( + "fmt" + "os" + "reflect" +) + + + +func showColour() bool { + return os.Getenv("NO_COLOUR") == "" +} + +func testing(message string, body func()) { + if showColour() { + fmt.Fprintf( + os.Stderr, + "\033[0;33mtesting\033[0m: %s... ", + message, + ) + body() + fmt.Fprintf(os.Stderr, "\033[0;32mOK\033[0m.\n") + } else { + fmt.Fprintf(os.Stderr, "testing: %s... ", message) + body() + fmt.Fprintf(os.Stderr, "OK.\n") + } +} + +func assertEq(given any, expected any) { + if !reflect.DeepEqual(given, expected) { + if showColour() { + fmt.Fprintf(os.Stderr, "\033[0;31mERR\033[0m.\n") + } else { + fmt.Fprintf(os.Stderr, "ERR.\n") + } + fmt.Fprintf(os.Stderr, "given != expected\n") + fmt.Fprintf(os.Stderr, "given: %#v\n", given) + fmt.Fprintf(os.Stderr, "expected: %#v\n", expected) + os.Exit(1) + } +} + + + +func MainTest() { + testing("string is the same after round-trip", func() { + str1 := New().String() + id, err := FromString(str1) + assertEq(err, nil) + str2 := id.String() + assertEq(str1, str2) + }) + + testing("UUID is the same after round-trip", func() { + id1 := New() + id2, err := FromString(id1.String()) + assertEq(err, nil) + assertEq(id1, id2) + }) +} -- cgit v1.2.3