#!/usr/bin/env bash

# Test that Flutter URL is correctly constructed without duplicate -stable suffix
# See: https://github.com/jdx/mise/discussions/7863

# Test that flutter versions can be listed (verifies registry parsing)
assert_contains "mise ls-remote flutter" "3.22.1"

# Test that the URL template handles versions correctly
# The fix uses replace filter to strip -stable suffix before adding it back
# This prevents URLs like flutter_linux_3.22.1-stable-stable.tar.xz

# Quick verification that flutter@3.22.1 resolves without error
# Using --dry-run to avoid actual download
assert_succeed "mise install flutter@3.22.1 --dry-run"
