mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 00:46:07 +00:00
move to test folder and fix import bug in shell
This commit is contained in:
19
tests/example.ar
Normal file
19
tests/example.ar
Normal file
@@ -0,0 +1,19 @@
|
||||
let getInitials(name) = do
|
||||
name = name.upper()
|
||||
namesplit = name.split(" ")
|
||||
i = 0
|
||||
while (i < namesplit.length) do
|
||||
namesplit[i] = namesplit[i][0]
|
||||
i = i + 1
|
||||
return namesplit.join("")
|
||||
|
||||
name = "william bell"
|
||||
term.log(getInitials(name))
|
||||
term.log(name)
|
||||
|
||||
let addLastName(name) = do
|
||||
name.append(" Bell")
|
||||
|
||||
name = "William"
|
||||
addLastName(name)
|
||||
term.log(name)
|
||||
10
tests/makerandom.ar
Normal file
10
tests/makerandom.ar
Normal file
@@ -0,0 +1,10 @@
|
||||
y = []
|
||||
i = 0
|
||||
while (i<1000000) do
|
||||
y.append(random())
|
||||
if (i % 100000 == 0) term.log(i)
|
||||
i = i + 1
|
||||
|
||||
term.time("write")
|
||||
open("array.json", "w").json(y)
|
||||
term.timeEnd("write")
|
||||
3
tests/test.ar
Normal file
3
tests/test.ar
Normal file
@@ -0,0 +1,3 @@
|
||||
import "csv" as csv
|
||||
|
||||
term.log(csv.read("tests/test.csv"))
|
||||
2
tests/test.csv
Normal file
2
tests/test.csv
Normal file
@@ -0,0 +1,2 @@
|
||||
hello,world
|
||||
1,2,3,4,5,6,7,8,9,10
|
||||
|
14
tests/thread.ar
Normal file
14
tests/thread.ar
Normal file
@@ -0,0 +1,14 @@
|
||||
f() = do
|
||||
term.log("Hello, world!")
|
||||
term.time("threaded function")
|
||||
for (i from 0 to 1000000) do
|
||||
if (i % 100000 == 0) do
|
||||
term.log("i = " + i)
|
||||
term.timeEnd("threaded function")
|
||||
term.log("Goodbye, world!")
|
||||
|
||||
t = thread(f)
|
||||
t.start()
|
||||
term.time("main thread")
|
||||
t.join()
|
||||
term.timeEnd("main thread")
|
||||
Reference in New Issue
Block a user