Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -48,6 +48,11 @@ public enum Language
CSharp,

#if CORECLR
/// <summary>
/// The C# programming language v7
/// </summary>
CSharpVersion7,

/// <summary>
/// The C# programming language v6
/// </summary>
Expand Down Expand Up @@ -633,6 +638,7 @@ internal bool IsCSharp(Language language)
case Language.CSharpVersion4:
case Language.CSharpVersion5:
case Language.CSharpVersion6:
case Language.CSharpVersion7:
#endif
return true;
default:
Expand Down Expand Up @@ -1217,6 +1223,9 @@ private void CompileSourceToAssembly(string source)
case Language.CSharpVersion6:
parseOptions = new CSharpParseOptions(LanguageVersion.CSharp6);
break;
case Language.CSharpVersion7:
parseOptions = new CSharpParseOptions(LanguageVersion.CSharp7);
break;
case Language.CSharp:
parseOptions = new CSharpParseOptions();
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
$guid = [Guid]::NewGuid().ToString().Replace("-","")

Describe "Add-Type" -Tags "CI" {
It "Public 'Language' enumeration contains all members" {
[Enum]::GetNames("Microsoft.PowerShell.Commands.Language") -join "," | Should Be "CSharp,CSharpVersion7,CSharpVersion6,CSharpVersion5,CSharpVersion4,CSharpVersion3,CSharpVersion2,CSharpVersion1,VisualBasic,JScript"
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a test case for 'Add-Type -Language CSharpVersion7'?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, should there be two commits (one for the product change and one for the test)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We checked it manually in the original Issue.
I didn't touch the functionality of this cmdlet. Besides, we don't even have tests for it right now. So I believe this is a separate huge job.
It seems @daxian-dbw is working on Add-Type. It would be good to agree on the distribution of work on tests.

I can say nothing about separate commits. 😕

Copy link
Member

Choose a reason for hiding this comment

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

Two commits (one for code changes and one for tests) is not a strict requirement.

It "Should not throw given a simple class definition" {
{ Add-Type -TypeDefinition "public static class foo { }" } | Should Not Throw
}
Expand Down