aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/lang/eval-okay-replacestrings.nix
blob: a803e65199a7b30c0d01fa1aa1c5c8bf7bcb0a5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
with builtins;

[ (replaceStrings ["o"] ["a"] "foobar")
  (replaceStrings ["o"] [""] "foobar")
  (replaceStrings ["oo"] ["u"] "foobar")
  (replaceStrings ["oo" "a"] ["a" "oo"] "foobar")
  (replaceStrings ["oo" "oo"] ["u" "i"] "foobar")
  (replaceStrings [""] ["X"] "abc")
  (replaceStrings [""] ["X"] "")
  (replaceStrings ["-"] ["_"] "a-b")
  (replaceStrings ["oo" "XX"] ["u" (throw "unreachable")] "foobar")
]