feat(scripts): Log global on the compile surface and both Test Run sandboxes; trust-gate pin (D4)
This commit is contained in:
@@ -139,6 +139,25 @@ public class RoslynScriptCompilerTests
|
||||
Assert.Empty(diagnostics);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Compile_Empty_ForTheLogGlobal()
|
||||
{
|
||||
// Flow Debugger step logs (design 2026-09-09 D4): `Log` is a script-reachable
|
||||
// global on the runtime ScriptGlobals AND on ScriptRuntimeContext, so both the
|
||||
// top-level `Log` and `Instance.Log` must bind at design time — otherwise a
|
||||
// script that logs would pass the editor but fail the deploy gate.
|
||||
const string code = """
|
||||
Log.Info("a");
|
||||
Log.Warn("b", new System.Exception("x"));
|
||||
Log.Error("c");
|
||||
Log.Debug("d");
|
||||
Instance.Log.Info("e");
|
||||
""";
|
||||
|
||||
var diagnostics = RoslynScriptCompiler.Compile(code, typeof(ScriptCompileSurface));
|
||||
Assert.Empty(diagnostics);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Compile_TwiceWithSharedResolver_StillCompilesCleanly()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user