summary refs log tree commit diff stats
path: root/nimsuggest/tests/fixtures/mstrutils.nim
diff options
context:
space:
mode:
Diffstat (limited to 'nimsuggest/tests/fixtures/mstrutils.nim')
-rw-r--r--nimsuggest/tests/fixtures/mstrutils.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/nimsuggest/tests/fixtures/mstrutils.nim b/nimsuggest/tests/fixtures/mstrutils.nim
new file mode 100644
index 000000000..d6f25571b
--- /dev/null
+++ b/nimsuggest/tests/fixtures/mstrutils.nim
@@ -0,0 +1,19 @@
+import mfakeassert
+
+func rereplace*(s, sub: string; by: string = ""): string {.used.} =
+  ## competes for priority in suggestion, here first, but never used in test
+
+  fakeAssert(true, "always works")
+  result = by
+
+func replace*(s, sub: string; by: string = ""): string =
+  ## this is a test version of strutils.replace, it simply returns `by`
+
+  fakeAssert("".len == 0, "empty string is empty")
+  result = by
+
+func rerereplace*(s, sub: string; by: string = ""): string {.used.} =
+  ## isn't used and appears last, lowest priority
+
+  fakeAssert(false, "never works")
+  result = by