diff --git a/Project.toml b/Project.toml index b1bc07e..ca2aa59 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Functors" uuid = "d9f16b24-f501-4c13-a1f2-28368ffc5196" authors = ["Mike J Innes "] -version = "0.2.6" +version = "0.2.7" [compat] julia = "1" diff --git a/src/Functors.jl b/src/Functors.jl index 54527a3..ae09d9d 100644 --- a/src/Functors.jl +++ b/src/Functors.jl @@ -3,5 +3,6 @@ module Functors export @functor, @flexiblefunctor, fmap, fmapstructure, fcollect include("functor.jl") +include("base.jl") end # module diff --git a/src/base.jl b/src/base.jl new file mode 100644 index 0000000..8a90dc6 --- /dev/null +++ b/src/base.jl @@ -0,0 +1 @@ +@functor Base.RefValue diff --git a/test/base.jl b/test/base.jl new file mode 100644 index 0000000..30c4598 --- /dev/null +++ b/test/base.jl @@ -0,0 +1,8 @@ +@testset "Base" begin + @testset "RefValue" begin + x = Ref(1) + p, re = Functors.functor(x) + @test p == (x = 1,) + @test re(p) isa Base.RefValue{Int} + end +end diff --git a/test/basics.jl b/test/basics.jl index 9d1ce76..21aa445 100644 --- a/test/basics.jl +++ b/test/basics.jl @@ -1,5 +1,3 @@ -using Functors, Test - struct Foo x y diff --git a/test/runtests.jl b/test/runtests.jl index d824e63..4ccc029 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,5 +3,6 @@ using Functors, Test @testset "Functors.jl" begin include("basics.jl") +include("base.jl") end