TestRuntimeConfiguration tests runtime configuration setters
(t *testing.T)
| 112 | |
| 113 | // TestRuntimeConfiguration tests runtime configuration setters |
| 114 | func TestRuntimeConfiguration(t *testing.T) { |
| 115 | rt := NewRuntime() |
| 116 | defer rt.Close() |
| 117 | |
| 118 | // Test all setters for coverage |
| 119 | rt.SetMemoryLimit(1024 * 1024) |
| 120 | rt.SetExecuteTimeout(5) |
| 121 | rt.SetMaxStackSize(16384) |
| 122 | rt.SetGCThreshold(2048) |
| 123 | rt.SetCanBlock(true) |
| 124 | rt.SetCanBlock(false) // Test both branches |
| 125 | rt.SetStripInfo(1) |
| 126 | |
| 127 | // Run garbage collection |
| 128 | rt.RunGC() |
| 129 | |
| 130 | ctx := rt.NewContext() |
| 131 | defer ctx.Close() |
| 132 | |
| 133 | result := ctx.Eval(`"configuration test"`) |
| 134 | defer result.Free() |
| 135 | require.False(t, result.IsException()) // Check for exceptions instead of error |
| 136 | require.Equal(t, "configuration test", result.ToString()) |
| 137 | } |
| 138 | |
| 139 | func TestRuntimeDiagnosticsAndRawContext(t *testing.T) { |
| 140 | rt := NewRuntime() |
nothing calls this directly
no test coverage detected