Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5a4b779

Browse files
committed
add ErrorException for @test_throws
1 parent 9f2d6de commit 5a4b779

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/reduce.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ x = randn(3, 4)
8484

8585
# maximum & minimum
8686

87-
@test_throws maximum(Int[])
88-
@test_throws minimum(Int[])
87+
@test_throws ErrorException maximum(Int[])
88+
@test_throws ErrorException minimum(Int[])
8989

9090
@test maximum([4, 5, 2, 3]) === 5
9191
@test minimum([4, 5, 2, 3]) === 2

test/shapes.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ using Base.Test
1010
@test mapshape((3,), ()) == (3,)
1111
@test mapshape((), (3,)) == (3,)
1212
@test mapshape((3,), (3,)) == (3,)
13-
@test_throws mapshape((3,), (4,))
13+
@test_throws ErrorException mapshape((3,), (4,))
1414

1515
@test mapshape((3,1), (3,)) == (3,1)
1616
@test mapshape((3,), (3,1)) == (3,1)
17-
@test_throws mapshape((3,1), (2,))
18-
@test_throws mapshape((3,1), (3,2))
17+
@test_throws ErrorException mapshape((3,1), (2,))
18+
@test_throws ErrorException mapshape((3,1), (3,2))
1919

2020
@test mapshape((3,4,5), (3,4,5)) == (3,4,5)
2121
@test mapshape((3,4,1), (3,4)) == (3,4,1)
2222
@test mapshape((3,4), (3,4,1,1)) == (3,4,1,1)
23-
@test_throws mapshape((3,4), (3,4,2))
24-
@test_throws mapshape((3,5), (3,4,1))
23+
@test_throws ErrorException mapshape((3,4), (3,4,2))
24+
@test_throws ErrorException mapshape((3,5), (3,4,1))
2525

2626
@test mapshape((3,4), (3,4), (3,4)) == (3,4)
2727
@test mapshape((3,4,1), (3,4), (3,4)) == (3,4,1)
2828
@test mapshape((3,4), (3,4,1), (3,4)) == (3,4,1)
2929
@test mapshape((3,4), (3,4), (3,4,1)) == (3,4,1)
3030
@test mapshape((3,4,1), (3,4), (3,4,1)) == (3,4,1)
31-
@test_throws mapshape((3,4), (3,4), (3,5))
31+
@test_throws ErrorException mapshape((3,4), (3,4), (3,5))
3232

3333
@test mapshape((3,4), (3,4), (3,4), (3,4)) == (3,4)
3434
@test mapshape((3,), (3,1), (3,1,1), (3,1,1,1)) == (3,1,1,1)

0 commit comments

Comments
 (0)