mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
injections(nix): add nixosTest.testScript + home-manager nvim config
(+ add Check to mkDerivation bash matches) (+ add Check to mkDerivation bash matches)
This commit is contained in:
parent
b171f948da
commit
628d5e442c
2 changed files with 99 additions and 0 deletions
70
tests/query/injections/nix/test-nix-injections.nix
Normal file
70
tests/query/injections/nix/test-nix-injections.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{ pkgs, stdenv }:
|
||||
# NOTE: This file is for testing queries. If evaluated with nix, this will probably error.
|
||||
{
|
||||
regex = builtins.match "^.*[{](.+)[}].*$" "blahblah {something} blahblah" [ "something" ];
|
||||
|
||||
drv1 = stdenv.mkDerivation {
|
||||
buildPhase = "mkdir $out";
|
||||
installPhase = ''
|
||||
echo "bar" > $out/foo.txt
|
||||
'';
|
||||
};
|
||||
|
||||
drv2 = pkgs.writeShellApplication {
|
||||
name = "shellApp";
|
||||
buildInputs = [];
|
||||
text = ''
|
||||
echo "Hello world!"
|
||||
'';
|
||||
};
|
||||
|
||||
drv3 = pkgs.runCommand "foo-bar" {} ''
|
||||
mkir $out
|
||||
echo "bar" > $out/foo.txt
|
||||
'';
|
||||
|
||||
drv4 = pkgs.writeShellScriptBin "hello" ''
|
||||
echo "Hello world!"
|
||||
'';
|
||||
|
||||
drv5 = pkgs.writeFishBin "hello" ''
|
||||
echo "Hello world!"
|
||||
'';
|
||||
|
||||
drv6 = pkgs.writeHaskellBin "hello" ''
|
||||
main :: IO ()
|
||||
main = putStrLn "Hello world!"
|
||||
'';
|
||||
|
||||
drv7 = pkgs.writeJSBin "hello" ''
|
||||
console.log('Hello world!');
|
||||
'';
|
||||
|
||||
drv8 = pkgs.writePerlBin "hello" ''
|
||||
print("Hello world!\n");
|
||||
'';
|
||||
|
||||
drv9 = pkgs.writePythonBin "hello" ''
|
||||
print("Hello world!");
|
||||
'';
|
||||
|
||||
drv10 = pkgs.writeRustBin "hello" ''
|
||||
fn main() {
|
||||
println!("Hello world!");
|
||||
}
|
||||
'';
|
||||
|
||||
drv11 = {
|
||||
nodes = null;
|
||||
testScript = ''
|
||||
print("Hello world!");
|
||||
'';
|
||||
};
|
||||
|
||||
mod1 = {
|
||||
type = "lua";
|
||||
config = ''
|
||||
require('nvim-treesitter.configs').setup()
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue