#!/usr/bin/env bash

# `--tool` replaces the config's request, so an uninstalled version leaves
# nothing for `mise which` to search. The error must blame the version rather
# than claiming the bin is not active in this directory.

assert "mise use dummy@1.0.0"

assert_fail_matches "mise which dummy --tool=dummy@2.0.0" 'dummy@2\.0\.0 is not installed[[:space:]]+.*mise install dummy@2\.0\.0.*mise ls dummy'

# A fuzzy request keeps the version the user asked for and names what it
# resolved to, so the reason the lookup missed is visible.
assert_fail_matches "mise which dummy --tool=dummy@2" 'dummy@2 is not installed \(resolved to 2\.0\.0\)'
