Skip to content

Commit 9c8a6ea

Browse files
Add Octave input request (#83)
* Add Octave input request * Update mock input
1 parent d569a38 commit 9c8a6ea

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

snippets/snippets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
"incomplete_code": "if true",
197197
"complete_code": "x = 1;",
198198
"syntax_error": "1 +",
199-
"input_prompt": "% Octave stdin doesn't support Jupyter input protocol",
199+
"input_prompt": "name = input(\"Enter: \")",
200200
"sleep_code": "pause(2)",
201201
"completion_var": "test_variable_for_completion",
202202
"completion_setup": "test_variable_for_completion = 42;",

src/tests.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,11 @@ fn test_stdin_input_request(
701701
return TestResult::Unsupported;
702702
}
703703

704-
let mock_input = "test_input_42";
704+
// Mock input includes quotes to ensure validity in languages like
705+
// GNU Octave, where unquoted undefined variables (e.g. `test_input_42`)
706+
// would cause a kernel error.
707+
// TODO: Make mock input language-dependent for robustness.
708+
let mock_input = "\"test_input_42\"";
705709

706710
match kernel.execute_with_stdin(&code, mock_input).await {
707711
Ok((reply, _iopub, received_input_request)) => {

0 commit comments

Comments
 (0)