From f4041badc41cacca084c3639be90f6ec520de951 Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Thu, 29 Jul 2021 16:02:35 +0200 Subject: [PATCH] TST: Add tests for errors --- test/runtests.jl | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 1485149..6190c00 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -23,9 +23,18 @@ using Test using CaosDB -if haskey(ENV, "SHELL") - shell_var = ENV["SHELL"] -else - shell_var = "default" +@testset "CaosDBUnitTests" begin + @testset "TestUtility" begin + if haskey(ENV, "SHELL") + shell_var = ENV["SHELL"] + else + shell_var = "default" + end + @test CaosDB.Utility.get_env_var("SHELL", "default") == shell_var + end + + @testset "TestExceptions" begin + @test CaosDB.Exceptions.evaluate_return_code(Cint(0)) == nothing + @test_throws CaosDB.Exceptions.CaosDBException CaosDB.Exceptions.evaluate_return_code(Cint(14)) + end end -@test CaosDB.Utility.get_env_var("SHELL", "default") == shell_var -- GitLab