Skip to content

Commit d06868f

Browse files
Merge pull request #142 from for-GET/andreineculau-patch-1
2 parents f4325ec + b3399b8 commit d06868f

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
timeout-minutes: 30
2020
strategy:
2121
fail-fast: false
22+
max-parallel: 1
2223
matrix:
2324
otp_vsn:
2425
- 'slim'

test/jesse_lib_tests.erl

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,21 @@ re_run_default_test_() ->
1414
application:unload(jesse)
1515
end,
1616
[
17-
{"Support ISO Latin-1 letters in \w by default",
17+
{"Support ISO Latin-1 letters in \\w by default",
1818
?_assertEqual(match,
1919
jesse_lib:re_run(<<"föø"/utf8>>, "^\\w+$"))},
20-
{"Support ISO Latin-1 numbers in \d by default",
20+
{"Support ISO Latin-1 numbers in \\d by default",
2121
?_assertEqual(match,
2222
jesse_lib:re_run(<<"123"/utf8>>, "^\\d+$"))},
23-
{"Support beyond ISO Latin-1 letters in \w by default",
23+
{"Support beyond ISO Latin-1 letters in \\w by default",
2424
?_assertEqual(match,
2525
jesse_lib:re_run(<<"fōô"/utf8>>, "^\\w+$"))},
26-
{"Support beyond ISO Latin-1 numbers in \d by default",
26+
{"Support beyond ISO Latin-1 numbers in \\d by default",
2727
?_assertEqual(match,
2828
jesse_lib:re_run(<<"3๓३"/utf8>>, "^\\d+$"))}
2929
]}.
3030

31+
-if(defined(OTP_RELEASE) andalso ?OTP_RELEASE >= 28).
3132
re_run_no_ucp_test_() ->
3233
{setup,
3334
fun() ->
@@ -36,16 +37,39 @@ re_run_no_ucp_test_() ->
3637
end,
3738
fun(_) -> application:unload(jesse) end,
3839
[
39-
{"Support ISO Latin-1 letters in \w without 'ucp'",
40+
{"Do not support ISO Latin-1 letters in \\w without 'ucp'",
41+
?_assertEqual(nomatch,
42+
jesse_lib:re_run(<<"föø"/utf8>>, "^\\w+$"))},
43+
{"Support ISO Latin-1 numbers in \\d without 'ucp'",
44+
?_assertEqual(match,
45+
jesse_lib:re_run(<<"123"/utf8>>, "^\\d+$"))},
46+
{"Do not support beyond ISO Latin-1 letters in \\w without 'ucp'",
47+
?_assertEqual(nomatch,
48+
jesse_lib:re_run(<<"fōô"/utf8>>, "^\\w+$"))},
49+
{"Do not support beyond ISO Latin-1 numbers in \\d without 'ucp'",
50+
?_assertEqual(nomatch,
51+
jesse_lib:re_run(<<"3๓३"/utf8>>, "^\\d+$"))}
52+
]}.
53+
-else.
54+
re_run_no_ucp_test_() ->
55+
{setup,
56+
fun() ->
57+
application:load(jesse),
58+
application:set_env(jesse, re_options, [unicode])
59+
end,
60+
fun(_) -> application:unload(jesse) end,
61+
[
62+
{"Support ISO Latin-1 letters in \\w without 'ucp'",
4063
?_assertEqual(match,
4164
jesse_lib:re_run(<<"föø"/utf8>>, "^\\w+$"))},
42-
{"Support ISO Latin-1 numbers in \d without 'ucp'",
65+
{"Support ISO Latin-1 numbers in \\d without 'ucp'",
4366
?_assertEqual(match,
4467
jesse_lib:re_run(<<"123"/utf8>>, "^\\d+$"))},
45-
{"Do not support beyond ISO Latin-1 letters in \w without 'ucp'",
68+
{"Do not support beyond ISO Latin-1 letters in \\w without 'ucp'",
4669
?_assertEqual(nomatch,
4770
jesse_lib:re_run(<<"fōô"/utf8>>, "^\\w+$"))},
48-
{"Do not support beyond ISO Latin-1 numbers in \d without 'ucp'",
71+
{"Do not support beyond ISO Latin-1 numbers in \\d without 'ucp'",
4972
?_assertEqual(nomatch,
5073
jesse_lib:re_run(<<"3๓३"/utf8>>, "^\\d+$"))}
5174
]}.
75+
-endif.

0 commit comments

Comments
 (0)