mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-18 05:21:57 +03:00
Add test case to demonstrate tracing, as discussed in issue 68.
The new evaluator allows us to have more direct control over evaluation order, and makes it straightforward to implement tracing primitives. There are two new primitives 'trace' and 'traceVal' in the Cryptol prelude that produce tracing output when evaluated. Fixes #68
This commit is contained in:
parent
e001310299
commit
5d1e1948d8
7
tests/issues/issue68.cry
Normal file
7
tests/issues/issue68.cry
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
f : [8] -> [8]
|
||||||
|
f x = 20 + x
|
||||||
|
|
||||||
|
// Note! This test case may be a bit fragile, as it
|
||||||
|
// tests the output of tracing, which depends on evaluation
|
||||||
|
// order.
|
||||||
|
traceTest = [ trace "Hi!" i (f i) | i <- [0 .. 10 ] ]
|
2
tests/issues/issue68.icry
Normal file
2
tests/issues/issue68.icry
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
:l issue68.cry
|
||||||
|
traceTest
|
15
tests/issues/issue68.icry.stdout
Normal file
15
tests/issues/issue68.icry.stdout
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
Loading module Cryptol
|
||||||
|
Loading module Cryptol
|
||||||
|
Loading module Main
|
||||||
|
Hi! 0
|
||||||
|
Hi! 1
|
||||||
|
Hi! 2
|
||||||
|
Hi! 3
|
||||||
|
Hi! 4
|
||||||
|
Hi! 5
|
||||||
|
Hi! 6
|
||||||
|
Hi! 7
|
||||||
|
Hi! 8
|
||||||
|
Hi! 9
|
||||||
|
Hi! 10
|
||||||
|
[0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e]
|
Loading…
Reference in New Issue
Block a user