123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- (use-modules
- ;; SRFI 64 for unit testing facilities
- (srfi srfi-64)
- (utils string-utils))
- (test-begin "string-utils-test")
- (test-group
- "stringify"
- (test-equal "stringify-positive-number"
- "1"
- (stringify 1))
- (test-equal "stringify-negative-number"
- "-1"
- (stringify -1))
- (test-equal "stringify-string-remains-the-same"
- "123"
- (stringify "123"))
- (test-equal "stringify-float"
- "3.14"
- (stringify 3.14))
- (test-equal "stringify-other"
- "ab1"
- (stringify 'ab1)))
- (test-group
- "n-times-string"
- (test-equal "n-times-string-1"
- "ababab"
- (n-times-string "ab" 3))
- (test-equal "n-times-string-2"
- "ab\nab\n"
- (n-times-string "ab\n" 2))
- (test-equal "n-times-string with 0 times the string should be empty string"
- ""
- (n-times-string "ab\n" 0)))
- (test-end "string-utils-test")
|