init commit
This commit is contained in:
21
tests/luau/map_filter.luau
Normal file
21
tests/luau/map_filter.luau
Normal file
@ -0,0 +1,21 @@
|
||||
--!strict
|
||||
|
||||
local Array = require("../../luau/src")
|
||||
|
||||
local numbers = Array.new()
|
||||
for i = 1, 100 do
|
||||
numbers:push(i)
|
||||
end
|
||||
print(numbers:debug_display(), "\nlength=", numbers:len())
|
||||
|
||||
local start = os.clock()
|
||||
|
||||
numbers:map(function(n: number)
|
||||
return tostring(n)
|
||||
end):foreach(function(e) print("(:map)squared=", e) end)
|
||||
|
||||
numbers:filter(function(n: number)
|
||||
return bit32.band(n, 1) ~= 0
|
||||
end):foreach(function(e) print("(:filter)odd=", e) end)
|
||||
|
||||
print(os.clock()-start)
|
11
tests/start.sh
Executable file
11
tests/start.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
touch results.txt
|
||||
|
||||
test () {
|
||||
echo "-- [Test: $1] --" > results.txt
|
||||
luau $2 >> results.txt
|
||||
echo "-- [Test: $1] --" >> results.txt
|
||||
}
|
||||
|
||||
test "map_filter" "./luau/map_filter.luau"
|
Reference in New Issue
Block a user