diff --git a/.travis.yml b/.travis.yml index 471af5d..271f45e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ notifications: email: false julia: - 1 + - 1.0 os: - linux - osx diff --git a/Project.toml b/Project.toml index 553146e..c2e56e2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,14 +1,14 @@ name = "CommonRLInterface" uuid = "d842c3ba-07a1-494f-bbec-f5741b0a3e98" authors = ["Zachary Sunberg and contributors"] -version = "0.2.0" +version = "0.2.1" [deps] MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" [compat] MacroTools = "0.5" -julia = "1.4" +julia = "1" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/runtests.jl b/test/runtests.jl index e60ea99..18fb650 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,16 +1,17 @@ using CommonRLInterface using Test +mutable struct LQREnv <: AbstractEnv + s::Float64 +end + @testset "from README" begin - mutable struct LQREnv <: AbstractEnv - s::Float64 - end function CommonRLInterface.reset!(m::LQREnv) m.s = 0.0 end - CommonRLInterface.actions(m::LQREnv) = (-1.0, 0.0, 1.0) + CommonRLInterface.actions(m::LQREnv) = [-1.0, 0.0, 1.0] CommonRLInterface.observe(m::LQREnv) = m.s CommonRLInterface.terminated(m::LQREnv) = false @@ -40,7 +41,7 @@ MyEnv() = MyEnv(1) function CommonRLInterface.reset!(env::MyEnv) env.state = 1 end -CommonRLInterface.actions(env::MyEnv) = (-1, 0, 1) +CommonRLInterface.actions(env::MyEnv) = [-1, 0, 1] CommonRLInterface.observe(env::MyEnv) = env.state CommonRLInterface.terminated(env::MyEnv) = false function CommonRLInterface.act!(env::MyEnv, a) @@ -57,7 +58,7 @@ MyGame() = MyGame(1) function CommonRLInterface.reset!(env::MyGame) env.state = 1 end -CommonRLInterface.actions(env::MyGame) = (-1, 1) +CommonRLInterface.actions(env::MyGame) = [-1, 1] CommonRLInterface.observe(env::MyGame) = env.state CommonRLInterface.terminated(env::MyGame) = false function CommonRLInterface.act!(env::MyGame, a) @@ -140,7 +141,7 @@ end end @testset "spaces" begin - @provide CommonRLInterface.valid_actions(env::MyEnv) = (0, 1) + @provide CommonRLInterface.valid_actions(env::MyEnv) = [0, 1] @test provided(valid_actions, env) @test issubset(valid_actions(env), actions(env)) @@ -156,4 +157,6 @@ end @test observations(env) == 1:10 end -include("examples/gridworld.jl") +if VERSION >= v"1.4" # not sure if this is the actual minimal version, but I know it will work + include("examples/gridworld.jl") +end