Rain: added parse tests for things related to time
This commit is contained in:
parent
ebf3040367
commit
ae262125da
|
@ -483,6 +483,9 @@ testDataType =
|
||||||
,fail ("int?int",RP.dataType)
|
,fail ("int?int",RP.dataType)
|
||||||
|
|
||||||
,pass ("channel bool",RP.dataType,assertEqual "testDataType 200" $ A.Chan A.DirUnknown nonShared A.Bool)
|
,pass ("channel bool",RP.dataType,assertEqual "testDataType 200" $ A.Chan A.DirUnknown nonShared A.Bool)
|
||||||
|
|
||||||
|
,pass ("time",RP.dataType,assertEqual "testDataType 300" A.Time)
|
||||||
|
,pass ("timer",RP.dataType,assertEqual "testDataType 301" $ A.UserDataType $ typeName "timer")
|
||||||
]
|
]
|
||||||
|
|
||||||
testDecl :: [ParseTest (Meta, A.Structured -> A.Structured)]
|
testDecl :: [ParseTest (Meta, A.Structured -> A.Structured)]
|
||||||
|
@ -561,6 +564,15 @@ testRun =
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
testTime :: [ParseTest A.Process]
|
||||||
|
testTime =
|
||||||
|
[
|
||||||
|
pass ("now t;",RP.statement, assertPatternMatch "testTime 0" $ tag2 A.GetTime DontCare (variablePattern "t"))
|
||||||
|
,fail ("now t",RP.statement)
|
||||||
|
,fail ("now ;",RP.statement)
|
||||||
|
,fail ("now t + t;",RP.statement)
|
||||||
|
]
|
||||||
|
|
||||||
--Returns the list of tests:
|
--Returns the list of tests:
|
||||||
tests :: Test
|
tests :: Test
|
||||||
tests = TestList
|
tests = TestList
|
||||||
|
@ -577,6 +589,7 @@ tests = TestList
|
||||||
parseTests testAssign,
|
parseTests testAssign,
|
||||||
parseTests testDataType,
|
parseTests testDataType,
|
||||||
parseTests testComm,
|
parseTests testComm,
|
||||||
|
parseTests testTime,
|
||||||
parseTests testRun,
|
parseTests testRun,
|
||||||
parseTests testDecl,
|
parseTests testDecl,
|
||||||
parseTests testTopLevelDecl
|
parseTests testTopLevelDecl
|
||||||
|
|
Loading…
Reference in New Issue
Block a user