Skip to content

Commit ec42896

Browse files
committed
Add support for literals
1 parent 37016ba commit ec42896

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "GPUToolbox"
22
uuid = "096a3bc2-3ced-46d0-87f4-dd12716f4bfc"
3-
version = "0.1.0"
3+
version = "0.2.0"
44

55
[compat]
66
julia = "1.10"

src/GPUToolbox.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ module GPUToolbox
22

33
include("simpleversion.jl") # exports SimpleVersion, @sv_str
44
include("ccalls.jl") # exports @checked, @debug_ccall, @gcsafe_ccall
5+
include("literals.jl")
56

67
end # module GPUToolbox

test/runtests.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,16 @@ using GPUToolbox
4343
end
4444

4545
# TODO: @debug_ccall and @gcsafe_ccall tests
46+
47+
@testset "Literals" begin
48+
@test 1i8 === Int8(1)
49+
@test 1i16 === Int16(1)
50+
@test 1i32 === Int32(1)
51+
@test_throws InexactError 128i8
52+
53+
@test 1u8 === UInt8(1)
54+
@test 1u16 === UInt16(1)
55+
@test 1u32 === UInt32(1)
56+
@test_throws InexactError 256u8
57+
end
4658
end

0 commit comments

Comments
 (0)