#!/usr/bin/env bash

cat <<EOF >mise.toml
tools.erlang = "1.0.0-erlang"
tools.node = "1.0.0-node"
tools.corenode = "22.0.0"
tools.python = "1.0.0-python"
tools.mytool = "2"
tools.mytool-lts = "lts"

[alias]
erlang = 'asdf:https://github.com/jdx/mise-tiny'
node = "asdf:tiny"
corenode = "core:node"
python = 'asdf:jdx/mise-tiny'
mytool = "asdf:tiny"
[alias.mytool-lts]
backend = "asdf:tiny"
versions = {lts = "1.0.1"}
EOF

assert_contains "mise x erlang -- mise-tiny" "mise-tiny: v1.0.0-erlang"
assert_contains "mise x node -- rtx-tiny" "rtx-tiny: v1.0.0-node"
assert_contains "mise x corenode -- node -v" "v22.0.0"
assert_contains "mise x python -- mise-tiny" "mise-tiny: v1.0.0-python"
assert_contains "mise x mytool -- rtx-tiny" "rtx-tiny: v2.1.0"
assert_contains "mise x mytool-lts -- rtx-tiny" "rtx-tiny: v1.0.1"

assert_contains "mise x rg@14.0.0 -- rg --version" "ripgrep 14.0.0"
