Skip to content

Commit

Permalink
Added some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rhennigan committed May 19, 2022
1 parent a789970 commit 0b52e59
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PacletInfo.wl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PacletObject[ <|
"Name" -> "SamplePublisher/MyPaclet",
"Description" -> "This is an example paclet!",
"Creator" -> "Sample Author",
"Version" -> "1.3.0",
"Version" -> "1.4.0",
"WolframVersion" -> "13.0+",
"License" -> "MIT",
"PublisherID" -> "SamplePublisher",
Expand Down
17 changes: 17 additions & 0 deletions Tests/AddOne.wlt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
VerificationTest[
Needs[ "SamplePublisher`MyPaclet`" ],
Null,
TestID -> "AddOne-Initialization"
]

VerificationTest[
AddOne @ 1,
2,
TestID -> "AddOne-1"
]

VerificationTest[
AddOne @ 2,
4,
TestID -> "AddOne-2"
]
17 changes: 17 additions & 0 deletions Tests/AddTwo.wlt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
VerificationTest[
Needs[ "SamplePublisher`MyPaclet`" ],
Null,
TestID -> "AddTwo-Initialization"
]

VerificationTest[
AddTwo @ 1,
3,
TestID -> "AddTwo-1"
]

VerificationTest[
AddTwo @ 2,
4,
TestID -> "AddTwo-2"
]
27 changes: 27 additions & 0 deletions Tests/Arithmetic.wlt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
VerificationTest[
Needs[ "SamplePublisher`MyPaclet`" ],
Null,
TestID -> "Arithmetic-Initialization"
]

naturalNumber[ n_ ] := Nest[ AddOne, 0, n ];
plus[ x_, y_ ] := Nest[ AddOne, x, y ];
times[ x_, y_ ] := Nest[ OperatorApplied[ plus ][ x ], 0, y ];

VerificationTest[
naturalNumber[ 5 ],
5,
TestID -> "NaturalNumbers"
]

VerificationTest[
plus[ 3, 4 ],
34,
TestID -> "Addition"
]

VerificationTest[
times[ 3, 4 ],
12,
TestID -> "Multiplication"
]

0 comments on commit 0b52e59

Please sign in to comment.