Skip to content

Commit

Permalink
More unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
ferd committed May 23, 2023
1 parent bb664f5 commit 0039235
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions apps/rebar/src/rebar_compiler_format.erl
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ format(Source, {Line, Column}, Extra, Desc, Config) ->
case CompilerErrFmt == rich andalso find_line(Line, Source) of
{ok, LnBin} ->
LnPad = lists:duplicate(length(integer_to_list(Line)), " "),
Arrow = cf:format("~!R~ts~!!",["^--"]),
Arrow = cf:format("~!R~ts~!!",["╰──"]),
?FMT(" ~ts ┌─ ~ts:~n"
" ~ts |~n"
" ~w | ~ts~n"
" ~ts | ~s~ts ~ts~ts~n~n",
" ~ts ~n"
" ~w ~ts~n"
" ~ts ~s~ts ~ts~ts~n~n",
[LnPad, Source,
LnPad,
Line, colorize(LnBin, Column),
Expand Down
18 changes: 9 additions & 9 deletions apps/rebar/test/rebar_compiler_format_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ nocolor(Config) ->
Path = ?config(file, Config),
Conf = ?config(conf, Config),
?assertEqual(" ┌─ "++Path++":"++?EOL++
" |"++?EOL++
" 1 | -module(noline_end);"++?EOL++
" | ^-- => unexpected token: ;"++?EOL++?EOL,
" "++?EOL++
" 1 -module(noline_end);"++?EOL++
" ╰── => unexpected token: ;"++?EOL++?EOL,
rebar_compiler_format:format(Path, {1,20}, "=> ", "unexpected token: ;", Conf)),
?assertEqual(" ┌─ "++Path++":"++?EOL++
" |"++?EOL++
" 11 | first character on line 11."++?EOL++
" | ^-- some message"++?EOL++?EOL,
" "++?EOL++
" 11 first character on line 11."++?EOL++
" │ ╰── some message"++?EOL++?EOL,
rebar_compiler_format:format(Path, {11,1}, "", "some message", Conf)),
?assertEqual(" ┌─ "++Path++":"++?EOL++
" |"++?EOL++
" 111 | case X of ^whatever % on line 111"++?EOL++
" | ^-- the character '^' is not expected here."++?EOL++?EOL,
" "++?EOL++
" 111 case X of ^whatever % on line 111"++?EOL++
" ╰── the character '^' is not expected here."++?EOL++?EOL,
rebar_compiler_format:format(Path, {111,11}, "", "the character '^' is not expected here.", Conf)),
%% invalid cases fall back to minimal mode
?assertEqual(Path++":-23:-42: invalid ranges."++?EOL,
Expand Down

0 comments on commit 0039235

Please sign in to comment.