From fac6d27d361be34887dc323a8b22ac87cec5d930 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 2 Nov 2023 13:57:37 +0100 Subject: [PATCH] Add tests, increase code coverage --- pkg/JuliaInterface/tst/utils.tst | 10 ++++++++++ test/conversion.jl | 3 +++ 2 files changed, 13 insertions(+) diff --git a/pkg/JuliaInterface/tst/utils.tst b/pkg/JuliaInterface/tst/utils.tst index 8544e1b1c..5fc170dc9 100644 --- a/pkg/JuliaInterface/tst/utils.tst +++ b/pkg/JuliaInterface/tst/utils.tst @@ -85,5 +85,15 @@ function ( arg... ) <> from Julia:parse end +## +gap> IsBound(Julia.Main.f00bar); +false +gap> Julia.Main.f00bar := 1; +1 +gap> IsBound(Julia.Main.f00bar); +true +gap> Unbind(Julia.Main.f00bar); +Error, cannot unbind Julia variables + ## gap> STOP_TEST( "utils.tst", 1 ); diff --git a/test/conversion.jl b/test/conversion.jl index 6aa05a93b..496b78eb2 100644 --- a/test/conversion.jl +++ b/test/conversion.jl @@ -75,6 +75,7 @@ x = GAP.evalstr("'x'") @test (@inferred GAP.gap_to_julia(Cuchar, x)) == Cuchar('x') @test GAP.gap_to_julia(x) == Cuchar('x') + @test GAP.gap_to_julia(Char, x) == Char('x') x = GAP.evalstr("(1,2,3)") @test_throws GAP.ConversionError GAP.gap_to_julia(Cuchar, x) end @@ -108,6 +109,8 @@ @test (@inferred GAP.gap_to_julia(Vector{UInt8}, x)) == UInt8[0x66, 0x6f, 0x6f] x = GAP.evalstr("[1,2,3]") @test (@inferred GAP.gap_to_julia(Vector{UInt8}, x)) == UInt8[1, 2, 3] + x = GAP.evalstr("(1,2,3)") + @test_throws GAP.ConversionError GAP.gap_to_julia(Vector{UInt8}, x) end @testset "BitVectors" begin