@@ -18,8 +18,10 @@ init_per_testcase(_, Config) ->
18
18
application :set_env (cf , colour_term , cf_term :has_color (" dumb" )),
19
19
FileName = filename :join (? config (priv_dir , Config ), " oracle.erl" ),
20
20
ok = file :write_file (FileName , oracle ()),
21
+ EmptyFileName = filename :join (? config (priv_dir , Config ), " empty.erl" ),
22
+ ok = file :write_file (EmptyFileName , " " ),
21
23
Conf = dict :from_list ([{compiler_error_format , rich }]),
22
- [{conf , Conf }, {file , FileName }, {term , OriginalTerm } | Config ].
24
+ [{conf , Conf }, {file , FileName }, {empty_file , EmptyFileName }, { term , OriginalTerm } | Config ].
23
25
24
26
end_per_testcase (_ , Config ) ->
25
27
case ? config (term , Config ) of
@@ -65,6 +67,7 @@ nocolor() ->
65
67
[{doc , " testing all sorts of planned output" }].
66
68
nocolor (Config ) ->
67
69
Path = ? config (file , Config ),
70
+ EmptyPath = ? config (empty_file , Config ),
68
71
Conf = ? config (conf , Config ),
69
72
? assertEqual (" ┌─ " ++ Path ++ " :" ++ ? EOL ++
70
73
" │" ++ ? EOL ++
@@ -90,5 +93,8 @@ nocolor(Config) ->
90
93
rebar_compiler_format :format (Path , {855 ,1 }, " " , " invalid ranges." , Conf )),
91
94
? assertEqual (" /very/fake/path.oof:1:1: unknown file." ++ ? EOL ,
92
95
rebar_compiler_format :format (" /very/fake/path.oof" , {1 ,1 }, " " , " unknown file." , Conf )),
96
+ % % empty file
97
+ ? assertEqual (EmptyPath ++ " :1:1: should fallback to the minimal output" ++ ? EOL ,
98
+ rebar_compiler_format :format (EmptyPath , {1 ,1 }, " " , " should fallback to the minimal output" , Conf )),
93
99
ok .
94
100
0 commit comments