Skip to content

Commit d988283

Browse files
committed
move seed to right before tests, add a literal function example to docs
1 parent 4e6b5e5 commit d988283

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ If you are a Julia package develper in need of a rule rewriting system for your
2525
```julia
2626
julia> using SymbolicUtils
2727

28-
julia> @syms x::Real y::Real z::Complex
28+
julia> @syms x::Real y::Real z::Complex f(::Number)::Real
2929
(x, y, z)
3030

3131
julia> 2x^2 - y + x^2
3232
(3 * (x ^ 2)) + (-1 * y)
3333

34+
julia> f(sin(x)^2 + cos(x)^2) + z
35+
f(1) + z
36+
3437
julia> r = @rule sinh(im * ~x) => sin(~x)
3538
sinh(im * ~x) => sin(~x)
3639

test/fuzz.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ function fuzz_test(ntrials)
100100
end
101101

102102
using Random: seed!
103-
seed!(6174)
104103

105104
@testset "Fuzz test" begin
106105

106+
seed!(6174)
107107
for i=1:2000
108108
fuzz_test(10)
109109
end

test/rulesets.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using Random: shuffle, seed!
22

3-
seed!(1729)
4-
53
@testset "Numeric" begin
64
@syms a::Integer b c d x::Real y::Number
75
@test simplify(x - y) == x + -1*y
@@ -71,6 +69,8 @@ end
7169
@testset "Shuffle Rules" begin
7270
@syms a::Integer b c d x::Real y::Number
7371
R1 = RuleSet(SymbolicUtils.SIMPLIFY_RULES)
72+
73+
seed!(1729)
7474
R2 = RuleSet(shuffle(R1.rules))
7575
simplify_shuffle_tester(ex) = (R2 R1)(ex) == (R1 R2)(ex)
7676

0 commit comments

Comments
 (0)