Skip to content

Commit 1cf33ed

Browse files
committed
test: allow unstable in tests
1 parent c87727d commit 1cf33ed

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

test/test_derivatives.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ end
170170
end
171171

172172
@testset "Test many operators" begin
173+
using DispatchDoctor
174+
173175
# Since we use `@nif` in evaluating expressions,
174176
# we can see if there are any issues with LARGE numbers of operators.
175177
num_ops = 100
@@ -198,7 +200,9 @@ end
198200
tree = gen_random_tree_fixed_size(20, only_basic_ops_operator, n_features, Float64)
199201
X = randn(Float64, n_features, 10)
200202
basic_eval = tree'(X, only_basic_ops_operator)
201-
many_ops_eval = tree'(X, many_ops_operators)
203+
many_ops_eval = allow_unstable() do
204+
tree'(X, many_ops_operators)
205+
end
202206
@test (all(isnan, basic_eval) && all(isnan, many_ops_eval)) ||
203207
basic_eval many_ops_eval
204208
end

test/test_parse.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,18 @@ end
9999

100100
@testitem "This also works for parsing mixed types" begin
101101
using DynamicExpressions
102+
using DispatchDoctor
103+
102104
v = [1, 2, 3]
103-
ex = @parse_expression(
104-
$v * tan(cos(5 + x)),
105-
operators = GenericOperatorEnum(;
106-
binary_operators=[*, +], unary_operators=[tan, cos]
107-
),
108-
variable_names = ["x"],
109-
)
105+
ex = allow_unstable() do
106+
@parse_expression(
107+
$v * tan(cos(5 + x)),
108+
operators = GenericOperatorEnum(;
109+
binary_operators=[*, +], unary_operators=[tan, cos]
110+
),
111+
variable_names = ["x"],
112+
)
113+
end
110114

111115
@test typeof(ex.tree) === Node{Any}
112116
@test typeof(ex.metadata.operators) <: GenericOperatorEnum

0 commit comments

Comments
 (0)