#!/usr/bin/env bash

# A tool's `os` option excludes platforms from `mise lock`: they are neither
# planned in --dry-run nor resolved, and no "not available" warning is printed.

export MISE_LOCKFILE=1
export MISE_LOCKFILE_PLATFORMS=linux-x64,macos-arm64

cat <<EOF >mise.toml
[tools]
jq = { version = "1.7.1", os = ["linux"] }
EOF

assert_contains "mise lock --dry-run 2>&1" "jq@1.7.1 for linux-x64"
assert_not_contains "mise lock --dry-run 2>&1" "jq@1.7.1 for macos-arm64"

output="$(mise lock 2>&1)"
assert_not_contains_text "$output" "not available for"
assert_contains "cat mise.lock" "platforms.linux-x64"
assert_not_contains "cat mise.lock" "platforms.macos-arm64"
