# name: test/extension/install_extension.test
# description: Test various ways of installing extensions
# group: [extension]

statement ok
PRAGMA enable_verification

# Now httpfs might be already loaded or not, we keep the test agnostic via REGEX https? that matches both http AND https

statement ok
set extension_directory='__TEST_DIR__/install_extension'

# Check defaults are correct
statement error
INSTALL will_never_exist;
----
<REGEX>:.*Failed to download extension "will_never_exist" at URL \"https?://extensions.duckdb.org.*

# Explicitly install from core
statement error
INSTALL will_never_exist FROM core;
----
<REGEX>:.*Failed to download extension "will_never_exist" at URL \"https?://extensions.duckdb.org.*

# Explicitly install from nightly
statement error
INSTALL will_never_exist FROM core_nightly;
----
<REGEX>:.*Failed to download extension "will_never_exist" at URL \"https?://nightly-extensions.duckdb.org.*

# Explicitly install from community
statement error
INSTALL will_never_exist FROM community;
----
<REGEX>:.*Failed to download extension "will_never_exist" at URL \"https?://community-extensions.duckdb.org.*

# Alias can not quoted: string literals are interpreted as paths
statement error
INSTALL will_never_exist FROM 'core';
----
IO Error: Failed to install local extension "will_never_exist", no access to the file at PATH

# Error message should point to extensions troubleshooting page
statement error
INSTALL will_never_exist FROM core;
----
For more info, visit https://duckdb.org/docs/stable/extensions/troubleshooting
