|
6 | 6 | -include_lib("stdlib/include/assert.hrl"). % Assertion macros for convenience |
7 | 7 |
|
8 | 8 | -export([all/0, groups/0, init_per_testcase/2, end_per_testcase/2]). |
9 | | --export([test_app/1, no_good_files/1, emits_warnings/1, ignore_regex/1]). |
| 9 | +-export([test_app/1, no_good_files/1, emits_warnings/1, ignore_regex/1, unicode/1]). |
10 | 10 |
|
11 | 11 | -spec all() -> [ct_suite:ct_test_def(), ...]. |
12 | 12 | all() -> |
13 | | - [test_app, no_good_files, emits_warnings, ignore_regex]. |
| 13 | + [test_app, no_good_files, emits_warnings, ignore_regex, unicode]. |
14 | 14 |
|
15 | 15 | -spec groups() -> [ct_suite:ct_group_def(), ...]. |
16 | 16 | groups() -> |
@@ -66,9 +66,18 @@ ignore_regex(_Config) -> |
66 | 66 | IgnoreRegEx = {ignore_regex, "[_@./#&+-=*]"}, |
67 | 67 | State2 = rebar_state:set(State1, spellcheck, [Files, IgnoreRegEx]), |
68 | 68 | {Res, _} = spellcheck(State2), |
69 | | - %% Check warning message |
70 | 69 | ?assertEqual(ok, Res). |
71 | 70 |
|
| 71 | +-spec unicode(ct_suite:ct_config()) -> ok | no_return(). |
| 72 | +unicode(_Config) -> |
| 73 | + ok = file:set_cwd("../../../../test/test_app"), |
| 74 | + {ok, State1} = init(), |
| 75 | + Files = {files, ["src/test_unicode.erl"]}, |
| 76 | + State2 = rebar_state:set(State1, spellcheck, [Files]), |
| 77 | + {error, ErrorMsg} = spellcheck(State2), |
| 78 | + %% Check warning message |
| 79 | + ?assertEqual(ErrorMsg, string:find(ErrorMsg, "spellcheck detect warning emits:")). |
| 80 | + |
72 | 81 | %% ============================================================================= |
73 | 82 | %% Helpers |
74 | 83 | %% ============================================================================= |
@@ -96,6 +105,10 @@ init_test_app() -> |
96 | 105 | "src/*.hrl"]}, |
97 | 106 | IgnoredFiles = |
98 | 107 | {ignore, |
99 | | - ["src/*_ignore.erl", "src/*_broken.erl", "src/*_warning.erl", "src/*_ignore_regex.erl"]}, |
| 108 | + ["src/*_ignore.erl", |
| 109 | + "src/*_broken.erl", |
| 110 | + "src/*_warning.erl", |
| 111 | + "src/*_ignore_regex.erl", |
| 112 | + "src/*_unicode.erl"]}, |
100 | 113 | IgnoreRegEx = {ignore_regex, "[_@./#&+-=*]"}, |
101 | 114 | rebar_state:set(State1, spellcheck, [Files, IgnoredFiles, IgnoreRegEx]). |
0 commit comments