Skip to content

Commit

Permalink
test(loaders/lua): add example
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Nov 13, 2023
1 parent 644636d commit cb3b1d4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/nixos/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/_snapshots/loaders
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#json
{"lua":{"x":"/nix/store/58jsfiycgk0k9qxlc69ywjd1mwad7szm-x.lua","y":"/nix/store/wmkr8p843pwbiwvfm2l7l2cwznx6jyc6-y.lua"}}
1 change: 1 addition & 0 deletions tests/loaders/__fixture/x.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("x")
1 change: 1 addition & 0 deletions tests/loaders/__fixture/y.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("y")
21 changes: 21 additions & 0 deletions tests/loaders/expr.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
omnibus,
lib,
haumea,
}:
let
inherit (omnibus) load;
in
{
lua = lib.mapAttrs (_: builtins.unsafeDiscardStringContext) (
load {
src = ./__fixture;
loader = with haumea; [
(matchers.regex "^(.+)\\.(lua)$" (
_: _: path:
path
))
];
}
);
}

0 comments on commit cb3b1d4

Please sign in to comment.