Converted the other pullRepCounts test over to the new system

This commit is contained in:
Neil Brown 2008-11-16 19:40:27 +00:00
parent fe3dd78db3
commit bcad0c225f

View File

@ -584,20 +584,32 @@ testPullRepCounts = TestList
] ]
) pullRepCounts ) pullRepCounts
,TestCase $ testPass "testPullRepCounts 6" ,forAllThree $ \blockType -> testOccamPassTransform "testPullRepCounts 6"
(nameAndStopCaringPattern "nonce" "nonce" $ nameAndStopCaringPattern "nonce2" "nonce2" $ mkPattern $ A.Seq emptyMeta $ (nameAndStopCaringPattern "nonce1" "A" . nameAndStopCaringPattern "nonce2" "B")
A.Spec emptyMeta (A.Specification emptyMeta (simpleName "nonce") (A.IsExpr emptyMeta A.ValAbbrev A.Int $ intLiteral 6)) $ (blockType
A.Spec emptyMeta (A.Specification emptyMeta (simpleName "i") [decl' (simpleName "X")
$ A.Rep emptyMeta (A.For emptyMeta (intLiteral 0) (exprVariable "nonce"))) $ (A.Rep emptyMeta (A.For emptyMeta (intLiteral 0) (intLiteral 6)))
A.Spec emptyMeta (A.Specification emptyMeta (simpleName "nonce2") (A.IsExpr emptyMeta A.ValAbbrev A.Int $ intLiteral 8)) $ [decl' (simpleName "Y")
A.Spec emptyMeta (A.Specification emptyMeta (simpleName "j") (A.Rep emptyMeta (A.For emptyMeta (intLiteral 1) (intLiteral 8)))
$ A.Rep emptyMeta (A.For emptyMeta (intLiteral 0) (exprVariable "nonce2"))) $ A.Several emptyMeta []) []
]
pullRepCounts (A.Seq emptyMeta $ A.Spec emptyMeta (A.Specification emptyMeta ]
(simpleName "i") $ A.Rep emptyMeta (A.For emptyMeta (intLiteral 0) (intLiteral 6))) $ `becomes`
A.Spec emptyMeta (A.Specification emptyMeta (simpleName "j") $ blockType
A.Rep emptyMeta (A.For emptyMeta (intLiteral 0) (intLiteral 8))) $ A.Several emptyMeta []) [decl'' (simpleName "A")
(return ()) (A.IsExpr emptyMeta A.ValAbbrev A.Int $ intLiteral 6) A.ValAbbrev
[decl' (simpleName "X")
(A.Rep emptyMeta (A.For emptyMeta (intLiteral 0) (exprVariable "A")))
[decl'' (simpleName "B")
(A.IsExpr emptyMeta A.ValAbbrev A.Int $ intLiteral 8) A.ValAbbrev
[decl' (simpleName "Y")
(A.Rep emptyMeta (A.For emptyMeta (intLiteral 1) (exprVariable "B")))
[]
]
]
]
]
) pullRepCounts
] ]
where where
forAllThree :: (forall a. Data a => ([Occ (A.Structured a)] -> Occ A.Process) -> Test) -> Test forAllThree :: (forall a. Data a => ([Occ (A.Structured a)] -> Occ A.Process) -> Test) -> Test