feat: add Stdin class with readLine and async stdin read support in io module
This commit is contained in:
+3
-3
@@ -83,7 +83,7 @@ class Test:
|
||||
|
||||
match = STDIN_PATTERN.search(line)
|
||||
if match:
|
||||
input_lines.append(match.group(1) + '\n')
|
||||
input_lines.append(match.group(1))
|
||||
|
||||
match = SKIP_PATTERN.search(line)
|
||||
if match:
|
||||
@@ -99,9 +99,9 @@ class Test:
|
||||
line_num += 1
|
||||
|
||||
|
||||
# If any input is fed to the test in stdin, concatetate it into one string.
|
||||
# If any input is fed to the test in stdin, concatenate it into one string.
|
||||
if input_lines:
|
||||
self.input_bytes = "".join(input_lines).encode("utf-8")
|
||||
self.input_bytes = "\n".join(input_lines).encode("utf-8")
|
||||
|
||||
# If we got here, it's a valid test.
|
||||
return True
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
29D009AD1B7E39A8000CE58C /* value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = value.h; path = ../../test/api/value.h; sourceTree = "<group>"; };
|
||||
29DE39511AC3A50A00987D41 /* wren_meta.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wren_meta.c; path = ../../src/vm/wren_meta.c; sourceTree = "<group>"; };
|
||||
29DE39521AC3A50A00987D41 /* wren_meta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_meta.h; path = ../../src/vm/wren_meta.h; sourceTree = "<group>"; };
|
||||
29F384111BD19706002F84E0 /* io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = io.h; path = ../../src/module/io.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -134,6 +135,7 @@
|
||||
2901D7611B74F3E20083A2C8 /* module */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29F384111BD19706002F84E0 /* io.h */,
|
||||
29729F2E1BA70A620099CA20 /* io.c */,
|
||||
29729F301BA70A620099CA20 /* io.wren.inc */,
|
||||
291647C31BA5EA45006142EE /* scheduler.h */,
|
||||
|
||||
Reference in New Issue
Block a user