From 0b52e5916576c14110c66d8860c521507d90421b Mon Sep 17 00:00:00 2001 From: Rick Hennigan Date: Thu, 19 May 2022 16:39:19 -0400 Subject: [PATCH] Added some tests --- PacletInfo.wl | 2 +- Tests/AddOne.wlt | 17 +++++++++++++++++ Tests/AddTwo.wlt | 17 +++++++++++++++++ Tests/Arithmetic.wlt | 27 +++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 Tests/AddOne.wlt create mode 100644 Tests/AddTwo.wlt create mode 100644 Tests/Arithmetic.wlt diff --git a/PacletInfo.wl b/PacletInfo.wl index 03b35a8..437dadf 100644 --- a/PacletInfo.wl +++ b/PacletInfo.wl @@ -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", diff --git a/Tests/AddOne.wlt b/Tests/AddOne.wlt new file mode 100644 index 0000000..3b2fb24 --- /dev/null +++ b/Tests/AddOne.wlt @@ -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" +] \ No newline at end of file diff --git a/Tests/AddTwo.wlt b/Tests/AddTwo.wlt new file mode 100644 index 0000000..99bc7e5 --- /dev/null +++ b/Tests/AddTwo.wlt @@ -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" +] \ No newline at end of file diff --git a/Tests/Arithmetic.wlt b/Tests/Arithmetic.wlt new file mode 100644 index 0000000..9e09116 --- /dev/null +++ b/Tests/Arithmetic.wlt @@ -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" +] \ No newline at end of file