mirror of
https://github.com/enso-org/enso.git
synced 2024-11-30 04:02:19 +03:00
Make execution mode live
default for CLI (#6496)
As requested in the design doc and in the ticket. Closes #6495.
This commit is contained in:
parent
d6fa36d793
commit
7e33300013
@ -362,7 +362,7 @@ object Main {
|
|||||||
.numberOfArgs(1)
|
.numberOfArgs(1)
|
||||||
.argName("name")
|
.argName("name")
|
||||||
.desc(
|
.desc(
|
||||||
"Execution environment to use during execution (`live`/`design`). Defaults to `design`."
|
"Execution environment to use during execution (`live`/`design`). Defaults to `live`."
|
||||||
)
|
)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
@ -1109,6 +1109,7 @@ object Main {
|
|||||||
line.hasOption(INSPECT_OPTION),
|
line.hasOption(INSPECT_OPTION),
|
||||||
line.hasOption(DUMP_GRAPHS_OPTION),
|
line.hasOption(DUMP_GRAPHS_OPTION),
|
||||||
Option(line.getOptionValue(EXECUTION_ENVIRONMENT_OPTION))
|
Option(line.getOptionValue(EXECUTION_ENVIRONMENT_OPTION))
|
||||||
|
.orElse(Some("live"))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (line.hasOption(REPL_OPTION)) {
|
if (line.hasOption(REPL_OPTION)) {
|
||||||
|
@ -23,8 +23,11 @@ spec =
|
|||||||
x = Runtime.no_inline_with_arg (x -> x + 4) 3
|
x = Runtime.no_inline_with_arg (x -> x + 4) 3
|
||||||
x . should_equal 7
|
x . should_equal 7
|
||||||
Test.group "Contexts and Execution Environment" <|
|
Test.group "Contexts and Execution Environment" <|
|
||||||
Test.specify "should prevent execution in the default design environment" <|
|
Test.specify "should not prevent execution in the default live environment" <|
|
||||||
res = Panic.catch Any (in_fn 1) p-> p.payload.to_text
|
res = Panic.catch Any (in_fn 1) p-> p.payload.to_text
|
||||||
|
res . should_equal 2
|
||||||
|
Test.specify "should prevent execution with explicitly disabled context" <|
|
||||||
|
res = Panic.catch Any (Runtime.with_disabled_context Input environment=Runtime.current_execution_environment (in_fn 1)) p-> p.payload.to_text
|
||||||
res . should_equal "(Forbidden_Operation.Error 'Input')"
|
res . should_equal "(Forbidden_Operation.Error 'Input')"
|
||||||
Test.specify "should be configurable" <|
|
Test.specify "should be configurable" <|
|
||||||
r1 = Runtime.with_enabled_context Input environment=Runtime.current_execution_environment <|
|
r1 = Runtime.with_enabled_context Input environment=Runtime.current_execution_environment <|
|
||||||
@ -32,7 +35,7 @@ spec =
|
|||||||
in_fn (out_fn 10)
|
in_fn (out_fn 10)
|
||||||
r1.should_equal 22
|
r1.should_equal 22
|
||||||
|
|
||||||
r2 = Panic.catch Any (Runtime.with_enabled_context Output environment=Runtime.current_execution_environment <| in_fn (out_fn 10)) p-> p.payload.to_text
|
r2 = Panic.catch Any (Runtime.with_disabled_context Input environment=Runtime.current_execution_environment <| in_fn (out_fn 10)) p-> p.payload.to_text
|
||||||
r2 . should_equal "(Forbidden_Operation.Error 'Input')"
|
r2 . should_equal "(Forbidden_Operation.Error 'Input')"
|
||||||
|
|
||||||
main = Test_Suite.run_main spec
|
main = Test_Suite.run_main spec
|
||||||
|
Loading…
Reference in New Issue
Block a user