mstrutils.nim 582 B

1234567891011121314151617181920
  1. import mfakeassert
  2. func rereplace*(s, sub: string; by: string = ""): string {.used.} =
  3. ## competes for priority in suggestion, here first, but never used in test
  4. fakeAssert(true, "always works")
  5. result = by
  6. func replace*(s, sub: string; by: string = ""): string =
  7. ## this is a test version of strutils.replace, it simply returns `by`
  8. fakeAssert("".len == 0, "empty string is empty")
  9. result = by
  10. func rerereplace*(s, sub: string; by: string = ""): string {.used.} =
  11. ## isn't used and appears last, lowest priority
  12. fakeAssert(false, "never works")
  13. result = by