Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/volumeops/volume_operator_test.jl @ 760:e7176fb09e98 test/type_stability
Add utility function for testing type stability using the @inferred macro to allow for tests failing, rather than producing an error.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 02 Jul 2021 14:02:45 +0200 |
parents | 80d88bb1c5bd |
children |
comparison
equal
deleted
inserted
replaced
759:80d88bb1c5bd | 760:e7176fb09e98 |
---|---|
110 @test_throws BoundsError (op_y*v)[Index(3,Interior),Index(10,Upper)] | 110 @test_throws BoundsError (op_y*v)[Index(3,Interior),Index(10,Upper)] |
111 @test_throws BoundsError (op_y*v)[Index(3,Interior),Index(3,Lower)] | 111 @test_throws BoundsError (op_y*v)[Index(3,Interior),Index(3,Lower)] |
112 end | 112 end |
113 | 113 |
114 @testset "Inferred" begin | 114 @testset "Inferred" begin |
115 @test_skip @inferred apply(op_x, v,1,1) | 115 @test is_type_stable(apply, op_x, v, 1, 1) |
116 @inferred apply(op_x, v, Index(1,Lower),Index(1,Lower)) | 116 @test is_type_stable(apply, op_x, v, Index(1,Lower), Index(1,Lower)) |
117 @inferred apply(op_x, v, Index(6,Interior),Index(1,Lower)) | 117 @test is_type_stable(apply, op_x, v, Index(6,Interior), Index(1,Lower)) |
118 @inferred apply(op_x, v, Index(11,Upper),Index(1,Lower)) | 118 @test is_type_stable(apply, op_x, v, Index(11,Upper), Index(1,Lower)) |
119 @test_skip @inferred apply(op_y, v,1,1) | 119 @test is_type_stable(apply, op_y, v, 1, 1) |
120 @inferred apply(op_y, v, Index(1,Lower),Index(1,Lower)) | 120 @test is_type_stable(apply, op_y, v, Index(1,Lower), Index(1,Lower)) |
121 @inferred apply(op_y, v, Index(1,Lower),Index(6,Interior)) | 121 @test is_type_stable(apply, op_y, v, Index(1,Lower), Index(6,Interior)) |
122 @inferred apply(op_y, v, Index(1,Lower),Index(11,Upper)) | 122 @test is_type_stable(apply, op_y, v, Index(1,Lower), Index(11,Upper)) |
123 end | 123 end |
124 end | 124 end |