Skip to content

Commit

Permalink
Merge pull request #3940 from JacquesCarette/SetTests
Browse files Browse the repository at this point in the history
Added basic set tests to `HelloWorld.hs`
  • Loading branch information
JacquesCarette authored Sep 19, 2024
2 parents 4482cb0 + 66db7a7 commit 9fbbbaa
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
7 changes: 5 additions & 2 deletions code/drasil-code/test/HelloWorld.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Drasil.GOOL (MSBody, MSBlock, MSStatement, SMethod, SVariable,
ControlStatement(..), VariableSym(var, constant), ScopeSym(..), Literal(..),
VariableValue(..), CommandLineArgs(..), NumericExpression(..),
BooleanExpression(..), Comparison(..), ValueExpression(..), extFuncApp,
List(..), MethodSym(..), OODeclStatement(objDecDef))
List(..), MethodSym(..), OODeclStatement(objDecDef), Set(..))
import qualified Drasil.GOOL as OO (GSProgram, ProgramSym(..), FileSym(..),
ModuleSym(..))
import Drasil.GProc (ProcProg)
Expand Down Expand Up @@ -88,7 +88,10 @@ helloInitVariables = block [comment "Initializing variables",
printLn (valueOf $ var "boringList" (listType bool)),
assert (valueOf (var "b" int) ?== litInt 5) (litString "b should be 5"),
assert (listSize (valueOf myOtherList) ?== litInt 4) (litString "myOtherList should have 4 elements"),
assert (valueOf (var "oneIndex" int) ?== litInt 0) (litString "oneIndex should be 0")]
assert (valueOf (var "oneIndex" int) ?== litInt 0) (litString "oneIndex should be 0"),
setDecDef (var "s" (setType int)) mainFn (litSet int [litInt 4, litInt 7, litInt 5]),
assert (contains (valueOf (var "s" (setType int))) (litInt 7))
(litString "Set s should contain 7")]

mySlicedList, mySlicedList2, mySlicedList3, mySlicedList4, mySlicedList5,
mySlicedList6, mySlicedList7, mySlicedList8, mySlicedList9,
Expand Down
4 changes: 4 additions & 0 deletions code/stable/gooltest/cpp/HelloWorld/HelloWorld.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions code/stable/gooltest/csharp/HelloWorld/HelloWorld.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions code/stable/gooltest/julia/HelloWorld/HelloWorld.jl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions code/stable/gooltest/python/HelloWorld/HelloWorld.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions code/stable/gooltest/swift/HelloWorld/main.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9fbbbaa

Please sign in to comment.