@@ -1810,3 +1810,91 @@ fn tool_run_from_at() {
18101810 + executable-application==0.2.0
18111811 "### ) ;
18121812}
1813+
1814+ #[ test]
1815+ fn tool_run_verbatim_name ( ) {
1816+ let context = TestContext :: new ( "3.12" ) . with_filtered_counts ( ) ;
1817+ let tool_dir = context. temp_dir . child ( "tools" ) ;
1818+ let bin_dir = context. temp_dir . child ( "bin" ) ;
1819+
1820+ // The normalized package name is `change-wheel-version`, but the executable is `change_wheel_version`.
1821+ uv_snapshot ! ( context. filters( ) , context. tool_run( )
1822+ . arg( "change_wheel_version" )
1823+ . arg( "--help" )
1824+ . env( EnvVars :: UV_TOOL_DIR , tool_dir. as_os_str( ) )
1825+ . env( EnvVars :: XDG_BIN_HOME , bin_dir. as_os_str( ) ) , @r###"
1826+ success: true
1827+ exit_code: 0
1828+ ----- stdout -----
1829+ usage: change_wheel_version [-h] [--local-version LOCAL_VERSION]
1830+ [--version VERSION] [--delete-old-wheel]
1831+ [--allow-same-version]
1832+ wheel
1833+
1834+ positional arguments:
1835+ wheel
1836+
1837+ options:
1838+ -h, --help show this help message and exit
1839+ --local-version LOCAL_VERSION
1840+ --version VERSION
1841+ --delete-old-wheel
1842+ --allow-same-version
1843+
1844+ ----- stderr -----
1845+ Resolved [N] packages in [TIME]
1846+ Prepared [N] packages in [TIME]
1847+ Installed [N] packages in [TIME]
1848+ + change-wheel-version==0.5.0
1849+ + installer==0.7.0
1850+ + packaging==24.0
1851+ + wheel==0.43.0
1852+ "### ) ;
1853+
1854+ uv_snapshot ! ( context. filters( ) , context. tool_run( )
1855+ . arg( "change-wheel-version" )
1856+ . arg( "--help" )
1857+ . env( EnvVars :: UV_TOOL_DIR , tool_dir. as_os_str( ) )
1858+ . env( EnvVars :: XDG_BIN_HOME , bin_dir. as_os_str( ) ) , @r###"
1859+ success: false
1860+ exit_code: 1
1861+ ----- stdout -----
1862+ The executable `change-wheel-version` was not found.
1863+ The following executables are provided by `change-wheel-version`:
1864+ - change_wheel_version
1865+ Consider using `uv tool run --from change-wheel-version <EXECUTABLE_NAME>` instead.
1866+
1867+ ----- stderr -----
1868+ Resolved [N] packages in [TIME]
1869+ warning: An executable named `change-wheel-version` is not provided by package `change-wheel-version`.
1870+ "### ) ;
1871+
1872+ uv_snapshot ! ( context. filters( ) , context. tool_run( )
1873+ . arg( "--from" )
1874+ . arg( "change-wheel-version" )
1875+ . arg( "change_wheel_version" )
1876+ . arg( "--help" )
1877+ . env( EnvVars :: UV_TOOL_DIR , tool_dir. as_os_str( ) )
1878+ . env( EnvVars :: XDG_BIN_HOME , bin_dir. as_os_str( ) ) , @r###"
1879+ success: true
1880+ exit_code: 0
1881+ ----- stdout -----
1882+ usage: change_wheel_version [-h] [--local-version LOCAL_VERSION]
1883+ [--version VERSION] [--delete-old-wheel]
1884+ [--allow-same-version]
1885+ wheel
1886+
1887+ positional arguments:
1888+ wheel
1889+
1890+ options:
1891+ -h, --help show this help message and exit
1892+ --local-version LOCAL_VERSION
1893+ --version VERSION
1894+ --delete-old-wheel
1895+ --allow-same-version
1896+
1897+ ----- stderr -----
1898+ Resolved [N] packages in [TIME]
1899+ "### ) ;
1900+ }
0 commit comments