mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-01 01:09:03 +03:00
[ nodejs ] pid
This commit is contained in:
parent
3c532ea35d
commit
158cb1c75e
@ -180,6 +180,7 @@ time : HasIO io => io Integer
|
|||||||
time = pure $ cast !(primIO prim__time)
|
time = pure $ cast !(primIO prim__time)
|
||||||
|
|
||||||
%foreign support "idris2_getPID"
|
%foreign support "idris2_getPID"
|
||||||
|
"node:lambda:() => process.pid"
|
||||||
prim__getPID : PrimIO Int
|
prim__getPID : PrimIO Int
|
||||||
|
|
||||||
||| Get the ID of the currently running process.
|
||| Get the ID of the currently running process.
|
||||||
|
@ -271,7 +271,7 @@ nodeTests = MkTestPool "Node backend" [] (Just Node)
|
|||||||
[ "node001", "node002", "node003", "node004", "node005", "node006"
|
[ "node001", "node002", "node003", "node004", "node005", "node006"
|
||||||
, "node007", "node008", "node009", "node011", "node012", "node015"
|
, "node007", "node008", "node009", "node011", "node012", "node015"
|
||||||
, "node017", "node018", "node019", "node021", "node022", "node023"
|
, "node017", "node018", "node019", "node021", "node022", "node023"
|
||||||
, "node024", "node025", "node026"
|
, "node024", "node025", "node026", "node027"
|
||||||
, "perf001"
|
, "perf001"
|
||||||
-- , "node14", "node020"
|
-- , "node14", "node020"
|
||||||
, "args"
|
, "args"
|
||||||
|
10
tests/node/node027/PID.idr
Normal file
10
tests/node/node027/PID.idr
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import System
|
||||||
|
|
||||||
|
assert : Bool -> IO ()
|
||||||
|
assert b = if b
|
||||||
|
then pure ()
|
||||||
|
else assert_total $ idris_crash ""
|
||||||
|
|
||||||
|
main : IO ()
|
||||||
|
main = do
|
||||||
|
assert $ !getPID /= 0
|
2
tests/node/node027/expected
Normal file
2
tests/node/node027/expected
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
1/1: Building PID (PID.idr)
|
||||||
|
Main> Main> Bye for now!
|
2
tests/node/node027/input
Normal file
2
tests/node/node027/input
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
:exec main
|
||||||
|
:q
|
3
tests/node/node027/run
Normal file
3
tests/node/node027/run
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
rm -rf build
|
||||||
|
|
||||||
|
$1 --cg node --no-banner --no-color --console-width 0 PID.idr < input
|
Loading…
Reference in New Issue
Block a user