Skip to content

Commit 788e9d5

Browse files
committed
update
1 parent 0ab59a3 commit 788e9d5

File tree

2 files changed

+35
-14
lines changed

2 files changed

+35
-14
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<img align="right" src="images/Ark.png" width=200px>
88

9-
* Documentation: [doc/main.md](doc/main.md)
9+
* Documentation: [https://github.com/SuperFola/Ark/wiki](Wiki)
1010

1111
**Nota bene**: the project is referred as "Ark" and as "ArkScript". The official public name is "ArkScript" since "Ark" is already being used by [another language](https://github.com/ark-lang/ark)
1212

@@ -15,7 +15,7 @@
1515
* Ark is small: the compiler, and the virtual machines fit under 5000 lines, but also small in term of keywords (it has only 10)!
1616
* Ark is a scripting language: it's very easy to embed it in your application. The FFI is quite easy to understand, so adding your own functions to the virtual machine is effortless
1717
* Ark can run everywhere: it produces a bytecode which is run by its virtual machine, like Java but without the `OutOfMemoryException`
18-
* Ark is a functional language: every parameters are by passed by value, everything is immutable unless you use `mut` to define a mutable variable
18+
* Ark is a functional language: every parameters are passed by value, everything is immutable unless you use `mut` to define a mutable variable
1919
* Ark can handle object oriented programming in a very elegant way with its closures and explicit captures (see examples/church-encoding)
2020
* Ark is promoting functionalities before performances: expressiveness often brings more productivity, but performances aren't bad at all
2121
* Ark handles first class objects, thus it has higher-order functions

tests/unittest.ark

+33-12
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
(set passed (+ 1 passed))
5555
}))
5656
(math-tests)
57-
(print "Math tests passed")
57+
(print " Math tests passed")
5858

5959
# --------------------------
6060
# Strings
@@ -91,7 +91,7 @@
9191
(set passed (+ 1 passed))
9292
}))
9393
(string-tests)
94-
(print "String tests passed")
94+
(print " String tests passed")
9595

9696
# --------------------------
9797
# List
@@ -130,7 +130,7 @@
130130
(set passed (+ 1 passed))
131131
}))
132132
(list-tests)
133-
(print "List tests passed")
133+
(print " List tests passed")
134134

135135
# --------------------------
136136
# misc
@@ -182,7 +182,7 @@
182182
(set passed (+ 1 passed))
183183
}))
184184
(misc-tests)
185-
(print "Misc tests passed")
185+
(print " Misc tests passed")
186186

187187
# --------------------------
188188
# switch
@@ -201,7 +201,7 @@
201201
])
202202
}))
203203
(switch-tests)
204-
(print "Switch tests passed")
204+
(print " Switch tests passed")
205205

206206
# --------------------------
207207
# defer
@@ -225,7 +225,7 @@
225225
(set passed (+ 1 passed))
226226
}))
227227
(defer-tests)
228-
(print "Defer tests passed")
228+
(print " Defer tests passed")
229229

230230
# --------------------------
231231
# recursion
@@ -255,7 +255,7 @@
255255
(assert (= (fibo 16) 987) "Fibo 16 test failed")
256256
(set passed (+ 1 passed))
257257

258-
(print "Recursion tests passed")
258+
(print " Recursion tests passed")
259259

260260
# --------------------------
261261
# callbacks
@@ -293,7 +293,7 @@
293293
(set passed (+ 1 passed))
294294
}))
295295
(callbacks-tests)
296-
(print "Callback tests passed")
296+
(print " Callback tests passed")
297297

298298
# --------------------------
299299
# OOP
@@ -321,7 +321,7 @@
321321
(set passed (+ 1 passed))
322322
}))
323323
(oop-test)
324-
(print "OOP tests passed")
324+
(print " OOP tests passed")
325325

326326
# --------------------------
327327
# Errors
@@ -341,7 +341,7 @@
341341
(set passed (+ 1 passed))
342342
}))
343343
(error-tests)
344-
(print "Error tests passed")
344+
(print " Error tests passed")
345345

346346
# --------------------------
347347
# Ranges
@@ -358,7 +358,7 @@
358358
(set passed (+ 1 passed))
359359
}))
360360
(range-test)
361-
(print "Range tests passed")
361+
(print " Range tests passed")
362362

363363
# --------------------------
364364
# Del
@@ -371,7 +371,28 @@
371371
(set passed (+ 1 passed))
372372
}))
373373
(del-test)
374-
(print "Del tests passed")
374+
(print " Del tests passed")
375+
376+
# --------------------------
377+
# Scopes
378+
# --------------------------
379+
(let scope-tests (fun () {
380+
(let foo (fun () {x}))
381+
382+
(let dummy1 (fun () {
383+
(let x 5)
384+
(foo)}))
385+
386+
(let dummy2 (fun () {
387+
(let x 10)
388+
(foo)}))
389+
390+
(assert (= 5 (dummy1)) "Scope test 1 failed")
391+
(assert (= 10 (dummy2)) "Scope test 1°2 failed")
392+
(set passed (+ 1 passed))
393+
}))
394+
(scope-tests)
395+
(print " Scope tests passed")
375396

376397
(print passed "tests passed!")
377398
(print "Completed in" (toString (- (time) start_time)) "seconds")

0 commit comments

Comments
 (0)