piston/runtimes/raku.nix

57 lines
1.1 KiB
Nix
Raw Normal View History

2022-02-07 03:10:04 +01:00
{pkgs, piston, ...}:
let
pkg = pkgs.rakudo;
in piston.mkRuntime {
language = "raku";
version = pkg.version;
aliases = [
"rakudo"
"perl6"
"p6"
"pl6"
];
run = ''
${pkg}/bin/raku "$@"
'';
tests = [
# test different extension
(piston.mkTest {
files = {
"file.code" = ''
say "OK"
'';
};
args = [];
stdin = "";
packages = [];
main = "file.code";
})
# test argv
(piston.mkTest {
files = {
"test.raku" = ''
print @*ARGS
'';
};
args = ["OK"];
stdin = "";
packages = [];
main = "test.raku";
})
# test stdin
(piston.mkTest {
files = {
"test.raku" = ''
say prompt
'';
};
args = [];
stdin = "OK";
packages = [];
main = "test.raku";
})
];
}