Skip to content

Commit 3c54082

Browse files
tkfjw3126
authored andcommitted
Use Tuple instead of Vector in test_quicktypes.jl (#39)
* Test against Julia 1.0 * Use the default test script * Fix after_success for Julia 1.0 * Enable tests with QuickTypes * Use Tuple instead of Vector in test_quicktypes.jl
1 parent d8a8730 commit 3c54082

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

.travis.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ os:
55
- osx
66
julia:
77
- 0.7
8+
- 1.0
89
- nightly
910
notifications:
1011
email: false
@@ -25,13 +26,10 @@ git:
2526
#before_script: # homebrew for mac
2627
# - if [ $TRAVIS_OS_NAME = osx ]; then brew install gcc; fi
2728

28-
# uncomment the following lines to override the default test script
29-
script:
30-
- julia -e 'Pkg.clone(pwd()); Pkg.build("Setfield"); VERSION < v"0.7-" && Pkg.add("StaticArrays"); Pkg.test("Setfield"; coverage=true)'
3129
after_success:
3230
# push coverage results to Coveralls
33-
- julia -e 'cd(Pkg.dir("Setfield")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
31+
- julia -e 'using Pkg; cd(Pkg.dir("Setfield")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
3432
# push coverage results to Codecov
35-
- julia -e 'cd(Pkg.dir("Setfield")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
36-
- julia -e 'Pkg.add("Documenter")'
37-
- julia -e 'cd(Pkg.dir("Setfield")); include(joinpath("docs", "make.jl"))'
33+
- julia -e 'using Pkg; cd(Pkg.dir("Setfield")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
34+
- julia -e 'using Pkg; Pkg.add("Documenter")'
35+
- julia -e 'using Pkg; cd(Pkg.dir("Setfield")); include(joinpath("docs", "make.jl"))'

test/runtests.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ end
2323
include("test_kwonly.jl")
2424
end
2525

26-
@static if VERSION < v"0.7-"
2726
@testset "QuickTypes.jl" begin
2827
include("test_quicktypes.jl")
2928
end
30-
end
3129

3230
end # module

test/test_quicktypes.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ end
6464
end
6565

6666

67-
@qstruct Pack{T}(animals::Vector{T})
67+
@qstruct Pack{T, N}(animals::NTuple{N, T})
6868

6969
@testset "Pack" begin
70-
x = Pack([Cat(:Tama, 1), Cat(:Pochi, 2)])
70+
x = Pack((Cat(:Tama, 1), Cat(:Pochi, 2)))
7171

7272
x = @set x.animals[2].nlegs = 5
73-
@test x.animals == [Cat(:Tama, 1), Cat(:Pochi, 2, 5)]
73+
@test x.animals == (Cat(:Tama, 1), Cat(:Pochi, 2, 5))
7474
end
7575

7676

@@ -116,9 +116,9 @@ end
116116
@qstruct Group{x}(members::x; _concise_show=true)
117117

118118
@testset "Group" begin
119-
x = Group([0, 1])
119+
x = Group((0, 1))
120120
x = @set x.members[2] = 111
121-
@test x.members == [0, 111]
121+
@test x.members == (0, 111)
122122
end
123123

124124
@settable @qstruct_fp Plane1(nwheels, weight::Number; brand=:zoomba)

0 commit comments

Comments
 (0)