diff options
Diffstat (limited to 'tests/stdlib/tregex.nim')
-rw-r--r-- | tests/stdlib/tregex.nim | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/stdlib/tregex.nim b/tests/stdlib/tregex.nim index bb4695f02..ae6714de1 100644 --- a/tests/stdlib/tregex.nim +++ b/tests/stdlib/tregex.nim @@ -2,30 +2,30 @@ discard """ file: "tregex.nim" output: "key: keyAYes!" """ -# Test the new regular expression module -# which is based on the PCRE library +# Test the new regular expression module +# which is based on the PCRE library when defined(powerpc64): # cheat as our powerpc test machine has no PCRE installed: echo "key: keyAYes!" -else: - import - re - - if "keyA = valueA" =~ re"\s*(\w+)\s*\=\s*(\w+)": - write(stdout, "key: ", matches[0]) - elif "# comment!" =~ re.re"\s*(\#.*)": - # test re.re"" syntax - echo("comment: ", matches[0]) - else: - echo("Bug!") - - if "Username".match(re"[A-Za-z]+"): - echo("Yes!") - else: - echo("Bug!") - - #OUT key: keyAYes! +else: + import + re + + if "keyA = valueA" =~ re"\s*(\w+)\s*\=\s*(\w+)": + write(stdout, "key: ", matches[0]) + elif "# comment!" =~ re.re"\s*(\#.*)": + # test re.re"" syntax + echo("comment: ", matches[0]) + else: + echo("Bug!") + + if "Username".match(re"[A-Za-z]+"): + echo("Yes!") + else: + echo("Bug!") + + #OUT key: keyAYes! |