-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add "require fnl creates cache" test
- Loading branch information
Showing
4 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{:value 0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
local t = require("my_file") | ||
|
||
-- actually check value cause exit(nil) probaby == 0 | ||
if t.value == 0 then | ||
os.exit(0) | ||
else | ||
os.exit(1) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
# place test file to into runtime | ||
cp $2/my_file.fnl /config/fnl/my_file.fnl | ||
|
||
cat <<EOF | assert "can import a fennel file without crashing" | ||
/test/nvim.sh $1 || fail "could not import fennel file" | ||
EOF | ||
|
||
cat <<EOF | assert "imported file is in cache" | ||
if [[ ! -f /root/.cache/nvim/hotpot/config/fnl/my_file.lua ]]; then | ||
exa --tree -a /root/.cache/nvim/hotpot >> /run.log | ||
fail "no cache file created" | ||
fi | ||
EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
cat <<EOF | assert "require(hotpot) does not crash" | ||
/test/nvim.sh require_hotpot || fail | ||
/test/nvim.sh $1 || fail | ||
EOF |