未验证 提交 64b18bef 编写于 作者: A AlekseyTs 提交者: GitHub

Add some tests (#45230)

上级 c7f09a26
...@@ -6804,6 +6804,11 @@ .maxstack 3 ...@@ -6804,6 +6804,11 @@ .maxstack 3
Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart)); Assert.Same(symbol.ContainingSymbol, model.GetEnclosingSymbol(x.SpanStart));
Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X")); Assert.Contains(symbol, model.LookupSymbols(x.SpanStart, name: "X"));
Assert.Contains("X", model.LookupNames(x.SpanStart)); Assert.Contains("X", model.LookupNames(x.SpanStart));
var baseWithargs = tree.GetRoot().DescendantNodes().OfType<SimpleBaseTypeSyntax>().Single();
Assert.Equal("Base(X, Y)", baseWithargs.ToString());
Assert.Null(model.GetTypeInfo(baseWithargs).Type);
Assert.Null(model.GetSymbolInfo(baseWithargs).Symbol);
} }
[Fact] [Fact]
......
...@@ -36,6 +36,9 @@ public void Simple_01() ...@@ -36,6 +36,9 @@ public void Simple_01()
Assert.True(entryPoint.ReturnsVoid); Assert.True(entryPoint.ReturnsVoid);
AssertEntryPointParameter(entryPoint); AssertEntryPointParameter(entryPoint);
CompileAndVerify(comp, expectedOutput: "Hi!"); 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) private static void AssertEntryPointParameter(SynthesizedSimpleProgramEntryPointSymbol entryPoint)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册