@@ -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 ).
3132re_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