File tree 1 file changed +22
-20
lines changed
lib/elixir/test/elixir/kernel
1 file changed +22
-20
lines changed Original file line number Diff line number Diff line change @@ -304,32 +304,34 @@ defmodule Kernel.RaiseTest do
304
304
assert result == "no match of right hand side value: 0"
305
305
end
306
306
307
- test :bad_key_error do
308
- result = try do
309
- % { % { } | foo: :bar }
310
- rescue
311
- x in [ KeyError ] -> Exception . message ( x )
312
- end
307
+ if :erlang . system_info ( :otp_release ) >= '18' do
308
+ test :bad_key_error do
309
+ result = try do
310
+ % { % { } | foo: :bar }
311
+ rescue
312
+ x in [ KeyError ] -> Exception . message ( x )
313
+ end
313
314
314
- assert result == "key :foo not found"
315
+ assert result == "key :foo not found"
315
316
316
- result = try do
317
- % { } . foo
318
- rescue
319
- x in [ KeyError ] -> Exception . message ( x )
317
+ result = try do
318
+ % { } . foo
319
+ rescue
320
+ x in [ KeyError ] -> Exception . message ( x )
321
+ end
322
+
323
+ assert result == "key :foo not found in: %{}"
320
324
end
321
325
322
- assert result == "key :foo not found in: %{}"
323
- end
326
+ test :bad_map_error do
327
+ result = try do
328
+ % { zero ( 0 ) | foo: :bar }
329
+ rescue
330
+ x in [ BadMapError ] -> Exception . message ( x )
331
+ end
324
332
325
- test :bad_map_error do
326
- result = try do
327
- % { zero ( 0 ) | foo: :bar }
328
- rescue
329
- x in [ BadMapError ] -> Exception . message ( x )
333
+ assert result == "expected a map, got: 0"
330
334
end
331
-
332
- assert result == "expected a map, got: 0"
333
335
end
334
336
335
337
test :case_clause_error do
You can’t perform that action at this time.
0 commit comments