Unverified Commit de0a829e authored by Konrad Malik's avatar Konrad Malik Committed by GitHub
Browse files

mise: add usage compatibility test (#369951)

parent 7d413989
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
  usage,
  mise,
  testers,
  runCommand,
  jq,
}:

rustPlatform.buildRustPackage rec {
@@ -89,7 +91,30 @@ rustPlatform.buildRustPackage rec {

  passthru = {
    updateScript = nix-update-script { };
    tests.version = testers.testVersion { package = mise; };
    tests = {
      version = testers.testVersion { package = mise; };
      usageCompat =
        # should not crash
        runCommand "mise-usage-compatibility"
          {
            nativeBuildInputs = [
              mise
              usage
              jq
            ];
          }
          ''
            export HOME=$(mktemp -d)

            spec="$(mise usage)"
            for shl in bash fish zsh; do
              echo "testing $shl"
              usage complete-word --shell $shl --spec "$spec"
            done

            touch $out
          '';
    };
  };

  meta = {