Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Collections.Generic;
using System.Management.Automation;
using System.Reflection;
Expand All @@ -31,11 +23,6 @@ public static IEnumerable<TypeData> 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")));
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/vs-csproj/System.Management.Automation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -1582,8 +1582,8 @@
<Compile Include="..\System.Management.Automation\engine\TypesV3_Ps1Xml.generated.cs">
<Link>engine\TypesV3_Ps1Xml.generated.cs</Link>
</Compile>
<Compile Include="..\System.Management.Automation\engine\Types_Ps1Xml.generated.cs">
<Link>engine\Types_Ps1Xml.generated.cs</Link>
<Compile Include="..\System.Management.Automation\engine\Types_Ps1Xml.cs">
<Link>engine\Types_Ps1Xml.cs</Link>
</Compile>
<Compile Include="..\System.Management.Automation\engine\TypeTable.cs">
<Link>engine\TypeTable.cs</Link>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
Describe "TestData cmdlets" -Tags "CI" {
Context "Get-TypeData" {
It "System.Array" {
(Get-TypeData System.Array).TypeName | Should Be System.Array
Get-TypeData System.Array | Should Be $null
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this test? Maybe remove?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just add it by analogy to other existing test. If you think, that it is not necessary here, then I can remove that last commit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this test using on-page edit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daxian-dbw You could just remove one last commit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PetSerAl Yes. I made this change with the online editor. But I'm going to squash and merge, so it should be fine.

}

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
Expand Down