Commit 55dec2a4 authored by Marc Jakobi's avatar Marc Jakobi Committed by Marc Jakobi
Browse files

zoxide: add nushell-integration test

parent 19edc32a
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -3,10 +3,14 @@
  stdenv,
  fetchFromGitHub,
  rustPlatform,
  runCommandLocal,
  withFzf ? true,
  fzf,
  installShellFiles,
  libiconv,
  testers,
  nushell,
  zoxide,
}:

rustPlatform.buildRustPackage (finalAttrs: {
@@ -31,6 +35,28 @@ rustPlatform.buildRustPackage (finalAttrs: {

  cargoHash = "sha256-4BXZ5NnwY2izzJFkPkECKvpuyFWfZ2CguybDDk0GDU0=";

  passthru = {
    tests = {
      version = testers.testVersion {
        package = zoxide;
      };
      nushell-integration =
        runCommandLocal "test-${zoxide.name}-nushell-integration"
          {
            nativeBuildInputs = [
              nushell
              zoxide
            ];
            meta.platforms = nushell.meta.platforms;
          }
          ''
            mkdir $out
            nu -c "zoxide init nushell | save zoxide.nu"
            nu -c "source zoxide.nu"
          '';
    };
  };

  postInstall = ''
    installManPage man/man*/*
    installShellCompletion --cmd zoxide \