Skip to content

Commit 2d33623

Browse files
committed
Fix issue with changed exception in codeunit test
1 parent 9eda0a5 commit 2d33623

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

test/basic.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ legacy_types = Dict(ASCIIStr => to_ascii,
2121
UTF16Str => utf16,
2222
UTF32Str => utf32)
2323

24+
const errtype =
25+
@static isdefined(Base, :CanonicalIndexError) ? Base.CanonicalIndexError : ErrorException
26+
2427
## create type specific test strings
2528
test_strings_base = Dict()
2629
for T in AllCharTypes
@@ -872,7 +875,7 @@ end
872875
@test u[1] == 0xe2
873876
@test u[2] == 0x88
874877
@test u[8] == 0x79
875-
@test_throws ErrorException (u[1] = 0x00)
878+
@test_throws errtype (u[1] = 0x00)
876879
@test collect(u) == b"∀x∃y"
877880
end
878881

test/util.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
b = testb()
315315
@test eltype(b) === UInt8
316316
@test b isa AbstractVector
317-
@test_throws ErrorException b[4] = '4'
317+
@test_throws errtype (b[4] = '4')
318318
@test testb() == UInt8['0','1','2','3']
319319
end
320320
end

0 commit comments

Comments
 (0)