feat: add type validation for IO.read prompt and stdin support in test runner

Add string type check for IO.read() prompt argument with Fiber.abort on non-string input. Implement stdin piping in test runner via // stdin: comments, allowing tests to provide input lines. Update stack trace filtering to omit built-in library frames with empty source paths. Add io/read.wren and io/read_arg_not_string.wren test cases.
This commit is contained in:
Bob Nystrom
2015-01-12 05:47:29 +00:00
parent e12b36002e
commit d6b70a0af3
8 changed files with 44 additions and 5 deletions
+1
View File
@@ -80,6 +80,7 @@ class IO {
}
static read(prompt) {
if (!(prompt is String)) Fiber.abort("Prompt must be a string.")
IO.write(prompt)
return IO.read
}