Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzaare committed May 28, 2024
1 parent b325aab commit 79c331a
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

/docs/build/

/test/benchmarks/
/test/mallocs/
/test/output/
/test/metadata/

*~
*.swp
Expand Down
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ julia = "1.9"
[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Chairmarks = "0ca39b1e-fe0b-4e98-acfc-b1656634c4de"
PatternFolds = "c18a7f1d-76ad-4ce4-950d-5419b888513b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "BenchmarkTools", "PatternFolds", "Test"]
test = ["Aqua", "BenchmarkTools", "Chairmarks", "PatternFolds", "Test"]
51 changes: 47 additions & 4 deletions test/pattern_folds.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
@testset "PatternFolds.jl" begin
x = @check :alloc Dict(:targets => ["PatternFolds"], :path => @__DIR__) begin
d = Dict(
:targets => ["PatternFolds"], :path => @__DIR__, :tags => [:patterns, :intervals],
:pkgs => ("PatternFolds", :custom, [v"0.2.1", v"0.2.4"], true))

x = @check :alloc d begin
using PatternFolds
end begin
itv = Interval{Open, Closed}(0.0, 1.0)
Expand All @@ -24,8 +28,47 @@

@info x

t = @check :benchmark Dict(
:path => @__DIR__, :evals => 1, :samples => 100, :seconds => 100) begin
d2 = Dict(:path => @__DIR__, :evals => 1, :samples => 100,
:seconds => 100, :tags => [:patterns, :intervals],
:pkgs => (
"PatternFolds", :custom, [v"0.2.1", v"0.2.4"], true),
:devops => "PatternFolds")

x2 = @check :benchmark d2 begin
using PatternFolds
end begin
# Intervals
itv = Interval{Open, Closed}(0.0, 1.0)
i = IntervalsFold(itv, 2.0, 1000)

unfold(i)
collect(i)
reverse(collect(i))

# rand(i, 1000)

# Vectors
vf = make_vector_fold([0, 1], 2, 1000)
# @info "Checking VectorFold" vf pattern(vf) gap(vf) folds(vf) length(vf)

unfold(vf)
collect(vf)
reverse(collect(vf))

rand(vf, 1000)

return nothing
end

@info x2

d3 = Dict(:path => @__DIR__, :evals => 1, :samples => 100,
:seconds => 100, :tags => [:patterns, :intervals],
:pkgs => (
"PatternFolds", :custom, [v"0.2.1", v"0.2.4"], true),
:devops => "PatternFolds")

x3 = @check :chairmark d3 begin
using PatternFolds
end begin
# Intervals
Expand All @@ -51,5 +94,5 @@
return nothing
end

@info t
@info x3
end
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ using Test

@testset "Other Packages" begin
using BenchmarkTools
using Chairmarks
using PerfChecker

# include("compositional_networks.jl")
include("pattern_folds.jl")
end

rm("metadata"; recursive = true)
rm("output"; recursive = true)
end

0 comments on commit 79c331a

Please sign in to comment.