git.iko.soy
/
Idris-dev
readme
files
commits
refs
on
master
help
sign in
added c test using modifyIORef'
01fdc75
Rui Barreiro
9 years ago
test/TestData.hs
+2
−1
compare with master
unified
split
@@ -72,7 +72,8 @@ testFamiliesData = [
72
(
18
,
ANY
),
72
(
18
,
ANY
),
73
(
19
,
ANY
),
73
(
19
,
ANY
),
74
(
20
,
ANY
),
74
(
20
,
ANY
),
75
−
(
21
,
C_CG
)
])
,
75
+
(
21
,
C_CG
),
76
+
(
22
,
NODE_CG
)]),
76
(
"bignum"
,
"Bignum"
,
77
(
"bignum"
,
"Bignum"
,
77
[ (
1
,
ANY
),
78
[ (
1
,
ANY
),
78
(
2
,
ANY
)]),
79
(
2
,
ANY
)]),
test/basic021/basic021_2.idr
new file
+13
@@ -0,0 +1,13 @@
1
+
import Data.IORef
2
+
3
+
count : HasReference ffi => Nat -> IORef Integer -> IO' ffi ()
4
+
count Z ref
5
+
= do x <- readIORef' ref
6
+
printLn' x
7
+
count (S k) ref
8
+
= do modifyIORef' ref (+1)
9
+
count k ref
10
+
11
+
main : IO ()
12
+
main = do r <- newIORef' 0
13
+
count 1000 r
test/basic021/expected
+1
@@ -1 +1,2 @@
1
1000000
1
1000000
2
+
1000
test/basic021/run
+3
−1
@@ -1,4 +1,6 @@
1
#!/usr/bin/env bash
1
#!/usr/bin/env bash
2
${IDRIS:-idris} $@ basic021.idr -o basic021
2
${IDRIS:-idris} $@ basic021.idr -o basic021
3
+
${IDRIS:-idris} $@ basic021_2.idr -o basic021_2
3
./basic021
4
./basic021
5
+
./basic021_2
4
−
rm -f basic021 *.ibc
6
+
rm -f basic021
basic021_2
*.ibc
keys
esc to close
j k
move down, up
enter
open
esc
back, or up a level
1 2 3 4
readme, files, commits, refs
/
filter
y
copy the clone command
c
compare the chosen commit with another (or shift-click both)
?
show or hide this list