mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib/utils: add literalLua
for use in option docs
Creates a `literalExpression` equivalent to using `lib.nixvim.mkRaw`.
This commit is contained in:
parent
de99f2938f
commit
eb76e62a9b
3 changed files with 45 additions and 0 deletions
|
@ -318,6 +318,19 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
testLiteralLua = {
|
||||
expr = builtins.mapAttrs (_: helpers.literalLua) {
|
||||
print = "print('hi')";
|
||||
nil = "nil";
|
||||
table = "{}";
|
||||
};
|
||||
expected = builtins.mapAttrs (_: lib.literalExpression) {
|
||||
print = ''lib.nixvim.mkRaw "print('hi')"'';
|
||||
nil = ''lib.nixvim.mkRaw "nil"'';
|
||||
table = ''lib.nixvim.mkRaw "{}"'';
|
||||
};
|
||||
};
|
||||
|
||||
testUpperFirstChar = {
|
||||
expr = map helpers.upperFirstChar [
|
||||
"foo"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue