1
0
Fork 0
mirror of https://github.com/emacs-twist/org-babel.git synced 2025-03-05 08:17:05 +00:00

test: Add tests for parameter parsing

This commit is contained in:
Akira Komamura 2022-02-06 00:55:17 +09:00
parent 116e37bc45
commit f550daa417
2 changed files with 44 additions and 0 deletions

View file

@ -19,3 +19,5 @@ jobs:
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: nix-instantiate --eval --strict test/test.nix
- name: Test parameter parsing
run: nix-instantiate --eval --strict test/testParams.nix

42
test/testParams.nix Normal file
View file

@ -0,0 +1,42 @@
# nix-instantiate --eval --strict test/testParams.nix
let
pkgs = import <nixpkgs> {};
parse = import ../nix/parseParamsString.nix;
in
pkgs.lib.runTests {
testSimple = {
expr = parse ":tangle no";
expected = {
":tangle" = "no";
};
};
testOdd = {
expr = parse ":async";
expected = {
":async" = true;
};
};
testNonAlpha = {
expr = parse ":session kernel-16577-ssh.json";
expected = {
":session" = "kernel-16577-ssh.json";
};
};
# This case is unsupported right now.
#
# testExpression = {
# expr = parse ":value '(this is so annoying)";
# expected = { };
# };
testDoubleQuotes = {
expr = parse ":caption \"Hello, I am Katja\"";
expected = {
":caption" = "Hello, I am Katja";
};
};
}