From 35860d0335dbdc53a64b4225bbd426c338e9ba46 Mon Sep 17 00:00:00 2001 From: PetSerAl Date: Tue, 28 Feb 2017 21:21:16 +0300 Subject: [PATCH 1/6] Rename Types_Ps1Xml.generated.cs --- .../engine/{Types_Ps1Xml.generated.cs => Types_Ps1Xml.cs} | 0 src/System.Management.Automation/map.json | 2 +- src/vs-csproj/System.Management.Automation.csproj | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/System.Management.Automation/engine/{Types_Ps1Xml.generated.cs => Types_Ps1Xml.cs} (100%) diff --git a/src/System.Management.Automation/engine/Types_Ps1Xml.generated.cs b/src/System.Management.Automation/engine/Types_Ps1Xml.cs similarity index 100% rename from src/System.Management.Automation/engine/Types_Ps1Xml.generated.cs rename to src/System.Management.Automation/engine/Types_Ps1Xml.cs diff --git a/src/System.Management.Automation/map.json b/src/System.Management.Automation/map.json index b94ba2448d6..f0daadbb30d 100644 --- a/src/System.Management.Automation/map.json +++ b/src/System.Management.Automation/map.json @@ -230,7 +230,7 @@ "monad/src/engine/ComInterop/IDispatchComObject.cs": "engine/ComInterop/IDispatchComObject.cs", "monad/src/engine/remoting/commands/ConnectPSSession.cs": "engine/remoting/commands/ConnectPSSession.cs", "monad/src/engine/resources/Logging.resx": "resources/Logging.resx", - "monad/src/engine/Types_Ps1Xml.generated.cs": "engine/Types_Ps1Xml.generated.cs", + "monad/src/engine/Types_Ps1Xml.cs": "engine/Types_Ps1Xml.cs", "monad/src/engine/remoting/common/WireDataFormat/EncodeAndDecode.cs": "engine/remoting/common/WireDataFormat/EncodeAndDecode.cs", "monad/src/commands/utility/FormatAndOutput/out-console/OutConsole.cs": "commands/utility/FormatAndOutput/out-console/OutConsole.cs", "monad/src/engine/debugger/debugger.cs": "engine/debugger/debugger.cs", diff --git a/src/vs-csproj/System.Management.Automation.csproj b/src/vs-csproj/System.Management.Automation.csproj index 533e3e038a8..e320fdb90c7 100644 --- a/src/vs-csproj/System.Management.Automation.csproj +++ b/src/vs-csproj/System.Management.Automation.csproj @@ -1582,8 +1582,8 @@ engine\TypesV3_Ps1Xml.generated.cs - - engine\Types_Ps1Xml.generated.cs + + engine\Types_Ps1Xml.cs engine\TypeTable.cs From 67402974744926ffe05b56af4ca246a480921f43 Mon Sep 17 00:00:00 2001 From: PetSerAl Date: Tue, 28 Feb 2017 21:23:06 +0300 Subject: [PATCH 2/6] Remove header from Types_Ps1Xml.cs --- src/System.Management.Automation/engine/Types_Ps1Xml.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/System.Management.Automation/engine/Types_Ps1Xml.cs b/src/System.Management.Automation/engine/Types_Ps1Xml.cs index d4918a39c69..980bac6b73a 100644 --- a/src/System.Management.Automation/engine/Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/Types_Ps1Xml.cs @@ -1,11 +1,3 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Management.Automation; using System.Reflection; From 0f8e3380fad9dbfdf4253adeed082317616cf60f Mon Sep 17 00:00:00 2001 From: PetSerAl Date: Tue, 28 Feb 2017 21:30:13 +0300 Subject: [PATCH 3/6] Remove System.Array type data --- src/System.Management.Automation/engine/Types_Ps1Xml.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/System.Management.Automation/engine/Types_Ps1Xml.cs b/src/System.Management.Automation/engine/Types_Ps1Xml.cs index 980bac6b73a..7c743250fb6 100644 --- a/src/System.Management.Automation/engine/Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/Types_Ps1Xml.cs @@ -23,11 +23,6 @@ public static IEnumerable Get() { TypeData td; - var td1 = new TypeData(@"System.Array", true); - td1.Members.Add("Count", - new AliasPropertyData("Count", "Length")); - yield return td1; - var td2 = new TypeData(@"System.Xml.XmlNode", true); td2.Members.Add("ToString", new CodeMethodData("ToString", GetMethodInfo(typeof(Microsoft.PowerShell.ToStringCodeMethods), @"XmlNode"))); From 80c03762597de92572403bb090ef7f01984a6cf7 Mon Sep 17 00:00:00 2001 From: PetSerAl Date: Tue, 28 Feb 2017 22:24:31 +0300 Subject: [PATCH 4/6] Change System.Array to System.DateTime in tests --- .../Microsoft.PowerShell.Utility/typedata.tests.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 index 2b59f03e480..4f5840346cb 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 @@ -1,19 +1,19 @@ Describe "TestData cmdlets" -Tags "CI" { Context "Get-TypeData" { - It "System.Array" { - (Get-TypeData System.Array).TypeName | Should Be System.Array + It "System.DateTime" { + (Get-TypeData System.DateTime).TypeName | Should Be System.DateTime # Supports pipelining? - ("System.Array" | Get-TypeData).TypeName | Should Be System.Array + ("System.DateTime" | Get-TypeData).TypeName | Should Be System.DateTime } It "Type accelerators" { - (Get-TypeData Array).TypeName | Should Be System.Array + (Get-TypeData DateTime).TypeName | Should Be System.DateTime (Get-TypeData psCredential).TypeName | Should Be System.Management.Automation.PSCredential } It "Accept multiple types" { - $types = Get-TypeData System.Array, System.Management.Automation* | Sort-Object -Property TypeName - $types[0].TypeName | Should Be System.Array + $types = Get-TypeData System.DateTime, System.Management.Automation* | Sort-Object -Property TypeName + $types[0].TypeName | Should Be System.DateTime for($i = 1; $i -lt $types.Count; $i++) { $types[$i].TypeName.StartsWith("System.Management.Automation") | Should Be $true From fd09cd7804fb760d08d9d39e172554c82f38f1a9 Mon Sep 17 00:00:00 2001 From: PetSerAl Date: Tue, 28 Feb 2017 22:26:06 +0300 Subject: [PATCH 5/6] Add test for absence of System.Array type data --- .../Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 index 4f5840346cb..32ffb7ebfb1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 @@ -1,5 +1,9 @@ Describe "TestData cmdlets" -Tags "CI" { Context "Get-TypeData" { + It "System.Array" { + Get-TypeData System.Array | Should Be $null + } + It "System.DateTime" { (Get-TypeData System.DateTime).TypeName | Should Be System.DateTime # Supports pipelining? From 0a1c96d4917ca09cd2e4a5ecd9b5b0c9591521c5 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 1 Mar 2017 12:18:21 -0800 Subject: [PATCH 6/6] Remove the test for `Get-TypeData System.Array` --- .../Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 index 32ffb7ebfb1..4f5840346cb 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 @@ -1,9 +1,5 @@ Describe "TestData cmdlets" -Tags "CI" { Context "Get-TypeData" { - It "System.Array" { - Get-TypeData System.Array | Should Be $null - } - It "System.DateTime" { (Get-TypeData System.DateTime).TypeName | Should Be System.DateTime # Supports pipelining?