Add E2E test for --version flag (#40125)

* Add E2E test for --version flag

Ensures both entry points (the 'version' subcommand and the '--version' flag)
are covered by E2E tests, preventing the two paths from drifting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix newline

---------

Co-authored-by: Pooja Trivedi <trivedipooja@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Pooja Trivedi
2026-04-07 13:57:28 -04:00
committed by GitHub
parent 715ce52834
commit 76606190d8

View File

@@ -56,6 +56,13 @@ class WSLCE2EGlobalTests
WSL2_TEST_ONLY();
RunWslcAndVerify(L"version", {.Stdout = GetVersionMessage(), .Stderr = L"", .ExitCode = 0});
}
TEST_METHOD(WSLCE2E_VersionFlag)
{
WSL2_TEST_ONLY();
RunWslcAndVerify(L"--version", {.Stdout = GetVersionMessage(), .Stderr = L"", .ExitCode = 0});
}
TEST_METHOD(WSLCE2E_Session_DefaultElevated)
{
WSL2_TEST_ONLY();