Mercurial > repos > public > sbplib_julia
changeset 218:03375aa30edd package_refactor
Add Tests and exports to RegionIndices
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 26 Jun 2019 12:57:20 +0200 |
parents | 4c62d0253bd4 |
children | 69a6049e14d9 |
files | RegionIndices/Project.toml RegionIndices/src/RegionIndices.jl RegionIndices/test/runtests.jl |
diffstat | 3 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/RegionIndices/Project.toml Wed Jun 26 12:55:01 2019 +0200 +++ b/RegionIndices/Project.toml Wed Jun 26 12:57:20 2019 +0200 @@ -2,3 +2,9 @@ uuid = "5d527584-97f1-11e9-084c-4540c7ecf219" authors = ["Jonatan Werpers <jonatan.werpers@it.uu.se>"] version = "0.1.0" + +[extras] +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["Test"]
--- a/RegionIndices/src/RegionIndices.jl Wed Jun 26 12:55:01 2019 +0200 +++ b/RegionIndices/src/RegionIndices.jl Wed Jun 26 12:57:20 2019 +0200 @@ -6,6 +6,8 @@ struct Upper <: Region end struct Unknown <: Region end +export Region, Interior, Lower, Upper, Unknown + struct Index{R<:Region, T<:Integer} i::T @@ -15,6 +17,8 @@ Index(t::Tuple{T, DataType}) where {R<:Region,T<:Integer} = Index{t[2],T}(t[1]) # TBD: This is not very specific in what types are allowed in t[2]. Can this be fixed? end +export Index + # Index(R::Type{<:Region}) = Index{R} ## Vill kunna skriva @@ -32,6 +36,7 @@ end IndexTuple(t::Vararg{Tuple{T, DataType}}) where T<:Integer = Index.(t) +export IndexTuple # TODO: Use the values of the region structs, e.g. Lower(), for the region parameter instead of the types. # For example the following works: