Skip to content

Commit

Permalink
add new tests for CPM
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytecode committed Feb 25, 2025
1 parent 54f5bb3 commit 47f3bdd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ Manifest.toml
# test.jl file is created for development purposes only
test.jl

.vscode/

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### 0.2.5 (Upcoming Release)

- Add new tests for CPM


### 0.2.4

Expand Down
17 changes: 17 additions & 0 deletions test/testcpm.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
@testset "CPM" verbose = true begin

@testset "Mini CPM Problem" begin
A = CpmActivity("A", 5)
B = CpmActivity("B", 10)
C = CpmActivity("C", 8, [A, B])

problem = CpmProblem([A, B, C])

result = solve(problem)

@test result isa CpmResult
@test result.pathstr == ["B", "C"]
@test result.path == [B, C]
@test earliestfinishtime(A) == 5
@test earliestfinishtime(B) == 10
@test earliestfinishtime(C) == 18
end

@testset "earliest finishing times of activities" begin
A = CpmActivity("A", 3)
B = CpmActivity("B", 2)
Expand Down

0 comments on commit 47f3bdd

Please sign in to comment.