From c9923eae0235de8ef917e4879ef241542f8d6292 Mon Sep 17 00:00:00 2001 From: Rowan Torbitzky-Lane Date: Mon, 27 Jan 2025 12:17:40 -0600 Subject: [PATCH] I'm gonna make these tests states soon --- test/Main.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/Main.hs b/test/Main.hs index 0a40805..5463126 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -5,6 +5,7 @@ import Instructions.FloatInstructions import Instructions.IntInstructions import Instructions.StringInstructions import Instructions.CharInstructions +import Instructions.VectorIntInstructions import Push import State @@ -44,6 +45,11 @@ charTestFunc name goal genome startState = let state = loadProgram genome startState in assert (goal == _char (interpretExec state)) putStrLn (name <> " passed test.") +intVectorTestFunc :: String -> [[Int]] -> [Gene] -> State -> IO () +intVectorTestFunc name goal genome startState = + let state = loadProgram genome startState + in assert (goal == _intVector (interpretExec state)) putStrLn (name <> " passed test.") + main :: IO () main = do -- Int tests @@ -245,3 +251,6 @@ main = do boolTestFunc "instructionCharIsLetterFalse" [False] [GeneChar '1', StateFunc instructionCharIsLetter] emptyState boolTestFunc "instructionCharIsDigitTrue" [True] [GeneChar '1', StateFunc instructionCharIsDigit] emptyState boolTestFunc "instructionCharIsDigitFalse" [False] [GeneChar 'a', StateFunc instructionCharIsDigit] emptyState + + -- vector int instructions + intVectorTestFunc "instructionIntVectorConcat" [[4,5,6,1,2,3]] [GeneIntVector [1,2,3], GeneIntVector [4,5,6], StateFunc instructionIntVectorConcat] emptyState