mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Validate the value for using namespace during semantic checks to prevent declaring invalid namespaces (#21162)
This commit is contained in:
@@ -128,7 +128,10 @@ Describe "Using Namespace" -Tags "CI" {
|
||||
|
||||
ShouldBeParseError "1; using namespace System" UsingMustBeAtStartOfScript 3
|
||||
ShouldBeParseError "using namespace Foo = System" UsingStatementNotSupported 0
|
||||
ShouldBeParseError "using namespace ''" InvalidNamespaceValue 16
|
||||
ShouldBeParseError "using namespace [System]" InvalidNamespaceValue 16
|
||||
ShouldBeParseError "using namespace ',System'" InvalidNamespaceValue 16
|
||||
ShouldBeParseError "using namespace ']System'" InvalidNamespaceValue 16
|
||||
# TODO: add diagnostic (low pri)
|
||||
# ShouldBeParseError "using namespace System; using namespace System" UsingNamespaceAlreadySpecified 24
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user