"IO" -> "System".
Get rid of the separate opt-in IO class and replace it with a core System class. - Remove wren_io.c, wren_io.h, and io.wren. - Remove the flags that disable it. - Remove the overloads for print() with different arity. (It was an experiment, but I don't think it's that useful.) - Remove IO.read(). That will reappear using libuv in the CLI at some point. - Remove IO.time. Doesn't seem to have been used. - Update all of the tests, docs, etc. I'm sorry for all the breakage this causes, but I think "System" is a better name for this class (it makes it natural to add things like "System.gc()") and frees up "IO" for referring to the CLI's IO module.
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
IO.print("abcd".indexOf("")) // expect: 0
|
||||
IO.print("abcd".indexOf("cd")) // expect: 2
|
||||
IO.print("abcd".indexOf("a")) // expect: 0
|
||||
IO.print("abcd".indexOf("abcd")) // expect: 0
|
||||
IO.print("abcd".indexOf("abcde")) // expect: -1
|
||||
IO.print("abab".indexOf("ab")) // expect: 0
|
||||
System.print("abcd".indexOf("")) // expect: 0
|
||||
System.print("abcd".indexOf("cd")) // expect: 2
|
||||
System.print("abcd".indexOf("a")) // expect: 0
|
||||
System.print("abcd".indexOf("abcd")) // expect: 0
|
||||
System.print("abcd".indexOf("abcde")) // expect: -1
|
||||
System.print("abab".indexOf("ab")) // expect: 0
|
||||
|
||||
// More complex cases.
|
||||
IO.print("abcdefabcdefg".indexOf("defg")) // expect: 9
|
||||
IO.print("abcdabcdabcd".indexOf("dab")) // expect: 3
|
||||
IO.print("abcdabcdabcdabcd".indexOf("dabcdabc")) // expect: 3
|
||||
IO.print("abcdefg".indexOf("abcdef!")) // expect: -1
|
||||
System.print("abcdefabcdefg".indexOf("defg")) // expect: 9
|
||||
System.print("abcdabcdabcd".indexOf("dab")) // expect: 3
|
||||
System.print("abcdabcdabcdabcd".indexOf("dabcdabc")) // expect: 3
|
||||
System.print("abcdefg".indexOf("abcdef!")) // expect: -1
|
||||
|
||||
// Non-ASCII. Note that it returns byte indices, not code points.
|
||||
IO.print("søméஃthîng".indexOf("e")) // expect: -1
|
||||
IO.print("søméஃthîng".indexOf("m")) // expect: 3
|
||||
IO.print("søméஃthîng".indexOf("thî")) // expect: 9
|
||||
System.print("søméஃthîng".indexOf("e")) // expect: -1
|
||||
System.print("søméஃthîng".indexOf("m")) // expect: 3
|
||||
System.print("søméஃthîng".indexOf("thî")) // expect: 9
|
||||
|
||||
// 8-bit clean.
|
||||
IO.print("a\0b\0c".indexOf("\0")) // expect: 1
|
||||
IO.print("a\0b\0c".indexOf("a")) // expect: 0
|
||||
IO.print("a\0b\0c".indexOf("b\0c")) // expect: 2
|
||||
IO.print("a\0b\0c".indexOf("a\0b\0c\0d")) // expect: -1
|
||||
IO.print("a\0b\0a\0b".indexOf("a\0b")) // expect: 0
|
||||
System.print("a\0b\0c".indexOf("\0")) // expect: 1
|
||||
System.print("a\0b\0c".indexOf("a")) // expect: 0
|
||||
System.print("a\0b\0c".indexOf("b\0c")) // expect: 2
|
||||
System.print("a\0b\0c".indexOf("a\0b\0c\0d")) // expect: -1
|
||||
System.print("a\0b\0a\0b".indexOf("a\0b")) // expect: 0
|
||||
|
||||
Reference in New Issue
Block a user