From 64b18befa1d778325282b554042e79357101e36b Mon Sep 17 00:00:00 2001 From: AlekseyTs Date: Tue, 16 Jun 2020 14:03:51 -0700 Subject: [PATCH] Add some tests (#45230) --- src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs | 5 +++++ .../Test/Semantic/Semantics/TopLevelStatementsTests.cs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs index 362ff2e321d86..acc856ef2f1ad 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs @@ -6804,6 +6804,11 @@ .maxstack 3 Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); Assert.Contains("X", model.LookupNames(x.SpanStart)); + + var baseWithargs = tree.GetRoot().DescendantNodes().OfType().Single(); + Assert.Equal("Base(X, Y)", baseWithargs.ToString()); + Assert.Null(model.GetTypeInfo(baseWithargs).Type); + Assert.Null(model.GetSymbolInfo(baseWithargs).Symbol); } [Fact] diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/TopLevelStatementsTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/TopLevelStatementsTests.cs index 1b967983d247e..8b5212d81f704 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/TopLevelStatementsTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/TopLevelStatementsTests.cs @@ -36,6 +36,9 @@ public void Simple_01() Assert.True(entryPoint.ReturnsVoid); AssertEntryPointParameter(entryPoint); CompileAndVerify(comp, expectedOutput: "Hi!"); + Assert.Same(entryPoint, comp.GetEntryPoint(default)); + Assert.False(entryPoint.CanBeReferencedByName); + Assert.False(entryPoint.ContainingType.CanBeReferencedByName); } private static void AssertEntryPointParameter(SynthesizedSimpleProgramEntryPointSymbol entryPoint)