diff --git a/README.md b/README.md index 1e05cf5a..0607365b 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a familiar, modern [syntax][]. ```dart -IO.print("Hello, world!") +System.print("Hello, world!") class Wren { flyTo(city) { - IO.print("Flying to ", city) + System.print("Flying to ", city) } } @@ -16,7 +16,7 @@ var adjectives = Fiber.new { ["small", "clean", "fast"].each {|word| Fiber.yield(word) } } -while (!adjectives.isDone) IO.print(adjectives.call()) +while (!adjectives.isDone) System.print(adjectives.call()) ``` * **Wren is small.** The VM implementation is under [4,000 semicolons][src]. diff --git a/builtin/core.wren b/builtin/core.wren index 77937448..dde36fcf 100644 --- a/builtin/core.wren +++ b/builtin/core.wren @@ -213,3 +213,38 @@ class MapValueSequence is Sequence { } class Range is Sequence {} + +class System { + static print() { + writeString_("\n") + } + + static print(obj) { + writeObject_(obj) + writeString_("\n") + return obj + } + + static printAll(sequence) { + for (object in sequence) writeObject_(object) + writeString_("\n") + } + + static write(obj) { + writeObject_(obj) + return obj + } + + static writeAll(sequence) { + for (object in sequence) writeObject_(object) + } + + static writeObject_(obj) { + var string = obj.toString + if (string is String) { + writeString_(string) + } else { + writeString_("[invalid toString]") + } + } +} diff --git a/builtin/io.wren b/builtin/io.wren deleted file mode 100644 index 6b8df735..00000000 --- a/builtin/io.wren +++ /dev/null @@ -1,101 +0,0 @@ -class IO { - static print { - writeString_("\n") - } - - static print(obj) { - writeObject_(obj) - writeString_("\n") - return obj - } - - static print(a1, a2) { - printAll([a1, a2]) - } - - static print(a1, a2, a3) { - printAll([a1, a2, a3]) - } - - static print(a1, a2, a3, a4) { - printAll([a1, a2, a3, a4]) - } - - static print(a1, a2, a3, a4, a5) { - printAll([a1, a2, a3, a4, a5]) - } - - static print(a1, a2, a3, a4, a5, a6) { - printAll([a1, a2, a3, a4, a5, a6]) - } - - static print(a1, a2, a3, a4, a5, a6, a7) { - printAll([a1, a2, a3, a4, a5, a6, a7]) - } - - static print(a1, a2, a3, a4, a5, a6, a7, a8) { - printAll([a1, a2, a3, a4, a5, a6, a7, a8]) - } - - static print(a1, a2, a3, a4, a5, a6, a7, a8, a9) { - printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9]) - } - - static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) { - printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]) - } - - static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) { - printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11]) - } - - static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { - printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12]) - } - - static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) { - printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13]) - } - - static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) { - printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14]) - } - - static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) { - printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15]) - } - - static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) { - printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16]) - } - - static printAll(sequence) { - for (object in sequence) writeObject_(object) - writeString_("\n") - } - - static write(obj) { - writeObject_(obj) - return obj - } - - static read(prompt) { - if (!(prompt is String)) Fiber.abort("Prompt must be a string.") - write(prompt) - return read() - } - - static writeObject_(obj) { - var string = obj.toString - if (string is String) { - writeString_(string) - } else { - writeString_("[invalid toString]") - } - } - - foreign static writeString_(string) - foreign static clock - foreign static time - foreign static read() -} diff --git a/doc/site/classes.markdown b/doc/site/classes.markdown index 60ca1631..a955e88c 100644 --- a/doc/site/classes.markdown +++ b/doc/site/classes.markdown @@ -25,7 +25,7 @@ To let our unicorn do stuff, we need to give it methods. :::dart class Unicorn { prance() { - IO.print("The unicorn prances in a fancy manner!") + System.print("The unicorn prances in a fancy manner!") } } @@ -35,7 +35,7 @@ parameters, put their names inside the parentheses: :::dart class Unicorn { prance(where, when) { - IO.print("The unicorn prances in " + where + " at " + when) + System.print("The unicorn prances in " + where + " at " + when) } } @@ -49,15 +49,15 @@ fine: :::dart class Unicorn { prance() { - IO.print("The unicorn prances in a fancy manner!") + System.print("The unicorn prances in a fancy manner!") } prance(where) { - IO.print("The unicorn prances in " + where) + System.print("The unicorn prances in " + where) } prance(where, when) { - IO.print("The unicorn prances in " + where + " at " + when) + System.print("The unicorn prances in " + where + " at " + when) } } @@ -83,7 +83,7 @@ Many methods on a class exist to expose or compute some property of the object. For example: :::dart - IO.print("string".count) // "6". + System.print("string".count) // "6". These *getters* are just another kind of method—one without a parameter list. You can define them like so: @@ -152,12 +152,12 @@ You can define operators in your class like so: class Unicorn { // Infix: +(other) { - IO.print("Adding to a unicorn?") + System.print("Adding to a unicorn?") } // Prefix: ! { - IO.print("Negating a unicorn?!") + System.print("Negating a unicorn?!") } } @@ -191,7 +191,7 @@ like so: :::dart class Unicorn { construct new(name, color) { - IO.print("My name is " + name + " and I am " + color + ".") + System.print("My name is " + name + " and I am " + color + ".") } } @@ -210,7 +210,7 @@ and each can clarify how it creates the instance: :::dart class Unicorn { construct brown(name) { - IO.print("My name is " + name + " and I am brown.") + System.print("My name is " + name + " and I am brown.") } } @@ -326,13 +326,13 @@ not the instance. They can be used in *both* instance and static methods. Just like instance fields, static fields are initially `null`: :::dart - IO.print(Foo.bar) // null. + System.print(Foo.bar) // null. They can be used from static methods: :::dart Foo.set("foo") - IO.print(Foo.bar) // foo. + System.print(Foo.bar) // foo. And also instance methods. When you do so, there is still only one static field shared among all instances of the class: @@ -342,7 +342,7 @@ shared among all instances of the class: var foo2 = Foo.new() foo1.setFromInstance("updated") - IO.print(foo2.baz) // updated. + System.print(foo2.baz) // updated. ## Inheritance @@ -381,7 +381,7 @@ This also means constructors are not inherited: :::dart class Unicorn { this new(name) { - IO.print("My name is " + name + ".") + System.print("My name is " + name + ".") } } @@ -398,7 +398,7 @@ This means you can do `super` calls inside a constructor: :::dart class Unicorn { this new(name) { - IO.print("My name is " + name + ".") + System.print("My name is " + name + ".") } } diff --git a/doc/site/control-flow.markdown b/doc/site/control-flow.markdown index 023082ca..e19a1624 100644 --- a/doc/site/control-flow.markdown +++ b/doc/site/control-flow.markdown @@ -31,7 +31,7 @@ The simplest branching statement, `if` lets you conditionally skip a chunk of code. It looks like this: :::dart - if (ready) IO.print("go!") + if (ready) System.print("go!") That evaluates the parenthesized expression after `if`. If it's true, then the statement after the condition is evaluated. Otherwise it is skipped. Instead of @@ -39,23 +39,23 @@ a statement, you can have a [block](syntax.html#blocks): :::dart if (ready) { - IO.print("getSet") - IO.print("go!") + System.print("getSet") + System.print("go!") } You may also provide an `else` branch. It will be executed if the condition is false: :::dart - if (ready) IO.print("go!") else IO.print("not ready!") + if (ready) System.print("go!") else System.print("not ready!") And, of course, it can take a block too: :::dart if (ready) { - IO.print("go!") + System.print("go!") } else { - IO.print("not ready!") + System.print("not ready!") } ## While statements @@ -100,7 +100,7 @@ That's what `for` is for. It looks like this: :::dart for (beatle in ["george", "john", "paul", "ringo"]) { - IO.print(beatle) + System.print(beatle) } A `for` loop has three components: @@ -124,7 +124,7 @@ keyword all by itself. That will immediately exit out of the nearest enclosing :::dart for (i in [1, 2, 3, 4]) { - IO.print(i) + System.print(i) if (i == 3) break } @@ -138,7 +138,7 @@ sequence of numbers, or loop a number of times. For that, you can create a :::dart for (i in 1..100) { - IO.print(i) + System.print(i) } This loops over the numbers from 1 to 100, including 100 itself. If you want to @@ -146,7 +146,7 @@ leave off the last value, use three dots instead of two: :::dart for (i in 1...100) { - IO.print(i) + System.print(i) } This looks like some special "range" syntax in the `for` loop, but it's @@ -168,7 +168,7 @@ When you write a loop like this: :::dart for (i in 1..100) { - IO.print(i) + System.print(i) } Wren sees it something like this: @@ -178,7 +178,7 @@ Wren sees it something like this: var seq_ = 1..100 while (iter_ = seq_.iterate(iter_)) { var i = seq_.iteratorValue(iter_) - IO.print(i) + System.print(i) } First, Wren evaluates the sequence expression and stores it in a hidden diff --git a/doc/site/core/bool.markdown b/doc/site/core/bool.markdown index fc5b991b..d1abb889 100644 --- a/doc/site/core/bool.markdown +++ b/doc/site/core/bool.markdown @@ -9,10 +9,9 @@ Boolean values. There are two instances, `true` and `false`. Returns the logical complement of the value. - > !true - false - > !false - true + :::dart + System.print(!true) // "false". + System.print(!false) // "true". ### toString diff --git a/doc/site/core/class.markdown b/doc/site/core/class.markdown index b26a827b..2d81afc0 100644 --- a/doc/site/core/class.markdown +++ b/doc/site/core/class.markdown @@ -15,14 +15,14 @@ The superclass of this class. class Crustacean {} class Crab is Crustacean {} - IO.print(Crab.supertype) // "Crustacean" + System.print(Crab.supertype) // "Crustacean". A class with no explicit superclass implicitly inherits Object: :::dart - IO.print(Crustacean.supertype) // "Object" + System.print(Crustacean.supertype) // "Object". Object forms the root of the class hierarchy and has no supertype: :::dart - IO.print(Object.supertype) // "null" + System.print(Object.supertype) // "null". diff --git a/doc/site/core/fiber.markdown b/doc/site/core/fiber.markdown index 0791127e..5add46fa 100644 --- a/doc/site/core/fiber.markdown +++ b/doc/site/core/fiber.markdown @@ -10,7 +10,7 @@ fiber is run. Does not immediately start running the fiber. :::dart var fiber = Fiber.new { - IO.print("I won't get printed") + System.print("I won't get printed") } ## Static Methods @@ -34,14 +34,14 @@ here means the last fiber that was started using `call` and not `run`. :::dart var fiber = Fiber.new { - IO.print("Before yield") + System.print("Before yield") Fiber.yield() - IO.print("After yield") + System.print("After yield") } - fiber.call() // "Before yield" - IO.print("After call") // "After call" - fiber.call() // "After yield" + fiber.call() // "Before yield" + System.print("After call") // "After call" + fiber.call() // "After yield" When resumed, the parent fiber's `call()` method returns `null`. @@ -50,7 +50,7 @@ If a yielded fiber is resumed by calling `call()` or `run()` with an argument, :::dart var fiber = Fiber.new { - IO.print(Fiber.yield()) // "value" + System.print(Fiber.yield()) // "value" } fiber.call() // Run until the first yield. @@ -65,7 +65,7 @@ later. :::dart Fiber.yield() - IO.print("this does not get reached") + System.print("this does not get reached") ### Fiber.**yield**(value) @@ -77,7 +77,7 @@ Similar to `Fiber.yield` but provides a value to return to the parent fiber's Fiber.yield("value") } - IO.print(fiber.call()) // "value" + System.print(fiber.call()) // "value" ## Methods @@ -87,9 +87,9 @@ Starts or resumes the fiber if it is in a paused state. :::dart var fiber = Fiber.new { - IO.print("Fiber called") + System.print("Fiber called") Fiber.yield() - IO.print("Fiber called again") + System.print("Fiber called again") } fiber.call() // Start it. @@ -103,7 +103,7 @@ If the called fiber is resuming from a yield, the `yield()` method returns :::dart var fiber = Fiber.new { - IO.print(Fiber.yield()) + System.print(Fiber.yield()) } fiber.call() @@ -116,7 +116,7 @@ Invokes the fiber or resumes the fiber if it is in a paused state and sets :::dart var fiber = Fiber.new { - IO.print(Fiber.yield()) + System.print(Fiber.yield()) } fiber.call() diff --git a/doc/site/core/fn.markdown b/doc/site/core/fn.markdown index df62d26c..6ef32684 100644 --- a/doc/site/core/fn.markdown +++ b/doc/site/core/fn.markdown @@ -13,7 +13,7 @@ argument](../functions.html#block-arguments) to some other method. :::dart var fn = Fn.new { - IO.print("The body") + System.print("The body") } It is a runtime error if `function` is not a function. @@ -25,8 +25,8 @@ It is a runtime error if `function` is not a function. The number of arguments the function requires. :::dart - IO.print(Fn.new {}.arity) // 0. - IO.print(Fn.new {|a, b, c| a }.arity) // 3. + System.print(Fn.new {}.arity) // 0. + System.print(Fn.new {|a, b, c| a }.arity) // 3. ### **call**(args...) @@ -34,7 +34,7 @@ Invokes the function with the given arguments. :::dart var fn = Fn.new { |arg| - IO.print(arg) + System.print(arg) } fn.call("Hello world") // Prints "Hello world". diff --git a/doc/site/core/index.markdown b/doc/site/core/index.markdown index 7a94d84c..f592d394 100644 --- a/doc/site/core/index.markdown +++ b/doc/site/core/index.markdown @@ -20,6 +20,6 @@ All Wren source files automatically have access to the following classes: * [Range](range.html) * [Sequence](sequence.html) * [String](string.html) -* [IO](io.html) +* [System](system.html) [embedding]: ../embedding-api.html diff --git a/doc/site/core/io.markdown b/doc/site/core/io.markdown deleted file mode 100644 index 054eaf4e..00000000 --- a/doc/site/core/io.markdown +++ /dev/null @@ -1,60 +0,0 @@ -^title IO Class -^category core - -The IO class can be used to read and write to and from the console. - -## Static Methods - -### IO.**print**(objects...) - -Prints a series of objects to the console followed by a newline. Each object is -converted to a string by calling `toString` on it. This is overloaded to -support up to 16 objects. To pass more, use `printAll()`. - - > IO.print("I like bananas") - I like bananas - > IO.print("Oranges", 10) - Oranges10 - -### IO.**printAll**(sequence) - -Iterates over [sequence] and prints each element, then prints a single newline -at the end. Each element is converted to a string by calling `toString` on it. - - > IO.printAll([1, [2, 3], 4]) - 1[2, 3]4 - -### IO.**write**(object) - -Prints a single value to the console, but does not print a newline character -afterwards. Converts the value to a string by calling `toString` on it. - - > IO.write(4 + 5) - 9> - -In the above example, the result of `4 + 5` is printed, and then the prompt is -printed on the same line because no newline character was printed afterwards. - -### IO.**read**() - -Reads in a line of text from stdin. Note that the returned text includes the -trailing newline. - - > var name = IO.read() - John - > IO.print("Hello " + name + "!") - Hello John - ! - > - -### IO.**read**(prompt) - -Displays `prompt` then reads in a line of text from stdin. Note that the -returned text includes the trailing newline. - - > var name = IO.read("Enter your name: ") - Enter your name: John - > IO.print("Hello " + name + "!") - Hello John - ! - > diff --git a/doc/site/core/list.markdown b/doc/site/core/list.markdown index 6de35b7b..ec75a651 100644 --- a/doc/site/core/list.markdown +++ b/doc/site/core/list.markdown @@ -26,14 +26,14 @@ Inserts the `item` at `index` in the list. :::dart var list = ["a", "b", "c", "d"] list.insert(1, "e") - IO.print(list) // "[a, e, b, c, d]" + System.print(list) // "[a, e, b, c, d]". The `index` may be one past the last index in the list to append an element. :::dart var list = ["a", "b", "c"] list.insert(3, "d") - IO.print(list) // "[a, b, c, d]" + System.print(list) // "[a, b, c, d]". If `index` is negative, it counts backwards from the end of the list. It bases this on the length of the list *after* inserted the element, so that `-1` will append the element, not insert it before the last element. @@ -41,12 +41,12 @@ If `index` is negative, it counts backwards from the end of the list. It bases t var list = ["a", "b"] list.insert(-1, "d") list.insert(-2, "c") - IO.print(list) // "[a, b, c, d]" + System.print(list) // "[a, b, c, d]". Returns the inserted item. :::dart - IO.print(["a", "c"].insert(1, "b")) // "b". + System.print(["a", "c"].insert(1, "b")) // "b". It is a runtime error if the index is not an integer or is out of bounds. @@ -64,11 +64,11 @@ are shifted up to fill in where the removed element was. :::dart var list = ["a", "b", "c", "d"] list.removeAt(1) - IO.print(list) // "[a, c, d]". + System.print(list) // "[a, c, d]". Returns the removed item. - IO.print(["a", "b", "c"].removeAt(1)) // "b". + System.print(["a", "b", "c"].removeAt(1)) // "b". It is a runtime error if the index is not an integer or is out of bounds. @@ -79,7 +79,7 @@ the end of the list where `-1` is the last element. :::dart var list = ["a", "b", "c"] - IO.print(list[1]) // "b". + System.print(list[1]) // "b". It is a runtime error if the index is not an integer or is out of bounds. @@ -91,6 +91,6 @@ backwards from the end of the list where `-1` is the last element. :::dart var list = ["a", "b", "c"] list[1] = "new" - IO.print(list) // "[a, new, c]". + System.print(list) // "[a, new, c]". It is a runtime error if the index is not an integer or is out of bounds. diff --git a/doc/site/core/map.markdown b/doc/site/core/map.markdown index b5ef691d..16e814f3 100644 --- a/doc/site/core/map.markdown +++ b/doc/site/core/map.markdown @@ -50,8 +50,8 @@ map, returns `null`. :::dart var map = {"george": "harrison", "ringo": "starr"} - IO.print(map["ringo"]) // "starr". - IO.print(map["pete"]) // "null". + System.print(map["ringo"]) // "starr". + System.print(map["pete"]) // "null". ### **[**key**]=**(value) operator diff --git a/doc/site/core/null.markdown b/doc/site/core/null.markdown index 4bca4ff9..033a008e 100644 --- a/doc/site/core/null.markdown +++ b/doc/site/core/null.markdown @@ -7,5 +7,5 @@ Returns `true`, since `null` is considered [false](../control-flow.html#truth). - > !null - true + :::dart + System.print(!null) // "true". diff --git a/doc/site/core/num.markdown b/doc/site/core/num.markdown index b617b374..baf86a81 100644 --- a/doc/site/core/num.markdown +++ b/doc/site/core/num.markdown @@ -132,9 +132,9 @@ from the beginning number to the ending number. :::dart var range = 1.2..3.4 - IO.print(range.min) // 1.2 - IO.print(range.max) // 3.4 - IO.print(range.isInclusive) // true + System.print(range.min) // 1.2 + System.print(range.max) // 3.4 + System.print(range.isInclusive) // true ### **...**(other) operator @@ -143,6 +143,6 @@ from the beginning number to the ending number not including the ending number. :::dart var range = 1.2...3.4 - IO.print(range.min) // 1.2 - IO.print(range.max) // 3.4 - IO.print(range.isInclusive) // false + System.print(range.min) // 1.2 + System.print(range.max) // 3.4 + System.print(range.isInclusive) // false diff --git a/doc/site/core/sequence.markdown b/doc/site/core/sequence.markdown index c80061b9..3a783f3d 100644 --- a/doc/site/core/sequence.markdown +++ b/doc/site/core/sequence.markdown @@ -59,7 +59,7 @@ and counting the number of times the returned value evaluates to `true`. Iterates over the sequence, passing each element to the given `function`. :::dart - ["one", "two", "three"].each {|word| IO.print(word) } + ["one", "two", "three"].each {|word| System.print(word) } ### **isEmpty** @@ -88,7 +88,7 @@ original sequence while it is iterated. :::dart var doubles = [1, 2, 3].map {|n| n * 2 } for (n in doubles) { - IO.print(n) // "2", "4", "6". + System.print(n) // "2", "4", "6". } The returned sequence is *lazy*. It only applies the mapping when you iterate @@ -105,7 +105,7 @@ To force eager evaluation, just call `.toList` on the result. var numbers = [1, 2, 3] var doubles = numbers.map {|n| n * 2 }.toList numbers.add(4) - IO.print(doubles) // [2, 4, 6]. + System.print(doubles) // [2, 4, 6]. ### **reduce**(function) @@ -142,7 +142,7 @@ function `predicate`. If it returns `false`, the element is skipped. :::dart var odds = (1..10).where {|n| n % 2 == 1 } for (n in odds) { - IO.print(n) // "1", "3", "5", "7", "9". + System.print(n) // "1", "3", "5", "7", "9". } The returned sequence is *lazy*. It only applies the filtering when you iterate @@ -160,4 +160,4 @@ To force eager evaluation, just call `.toList` on the result. var numbers = [1, 2, 3, 4, 5, 6] var odds = numbers.where {|n| n % 2 == 1 }.toList numbers.add(7) - IO.print(odds) // [1, 3, 5]. + System.print(odds) // [1, 3, 5]. diff --git a/doc/site/core/string.markdown b/doc/site/core/string.markdown index 2c68a7d9..8ada08ca 100644 --- a/doc/site/core/string.markdown +++ b/doc/site/core/string.markdown @@ -37,7 +37,7 @@ on strings *return* byte indexes too. So, for example, this does what you want: :::dart var metalBand = "Fäcëhämmër" var hPosition = metalBand.indexOf("h") - IO.print(metalBand[hPosition]) // "h" + System.print(metalBand[hPosition]) // "h" If you want to work with a string as a sequence numeric code points, call the `codePoints` getter. It returns a [Sequence](sequence.html) that decodes UTF-8 @@ -68,7 +68,7 @@ methods, the returned object also has a subscript operator that can be used to directly index bytes. :::dart - IO.print("hello".bytes[1]) // 101, for "e". + System.print("hello".bytes[1]) // 101, for "e". The `count` method on the returned sequence returns the number of bytes in the string. Unlike `count` on the string itself, it does not have to iterate over @@ -83,15 +83,15 @@ single-character strings, this returns the numeric code point values. :::dart var string = "(ᵔᴥᵔ)" - IO.print(string.codePoints[0]) // 40, for "(". - IO.print(string.codePoints[4]) // 7461, for "ᴥ". + System.print(string.codePoints[0]) // 40, for "(". + System.print(string.codePoints[4]) // 7461, for "ᴥ". If the byte at `index` does not begin a valid UTF-8 sequence, or the end of the string is reached before the sequence is complete, returns `-1`. :::dart var string = "(ᵔᴥᵔ)" - IO.print(string.codePoints[2]) // -1, in the middle of "ᵔ". + System.print(string.codePoints[2]) // -1, in the middle of "ᵔ". ### **contains**(other) @@ -132,7 +132,7 @@ for iterating over the *code points* in the string: codePoints.add(c) } - IO.print(codePoints) // ["(", "ᵔ", "ᴥ", "ᵔ", ")"]. + System.print(codePoints) // ["(", "ᵔ", "ᴥ", "ᵔ", ")"]. If the string contains any bytes that are not valid UTF-8, this iterates over those too, one byte at a time. @@ -162,7 +162,7 @@ Check if the string is not equal to `other`. Returns a string containing the code point starting at byte `index`. :::dart - IO.print("ʕ•ᴥ•ʔ"[5]) // "ᴥ". + System.print("ʕ•ᴥ•ʔ"[5]) // "ᴥ". Since `ʕ` is two bytes in UTF-8 and `•` is three, the fifth byte points to the bear's nose. @@ -171,7 +171,7 @@ If `index` points into the middle of a UTF-8 sequence or at otherwise invalid UTF-8, this returns a one-byte string containing the byte at that index: :::dart - IO.print("I ♥ NY"[3]) // One-byte string whose value is 153. + System.print("I ♥ NY"[3]) // One-byte string whose value is 153. It is a runtime error if `index` is greater than the number of bytes in the string. diff --git a/doc/site/core/system.markdown b/doc/site/core/system.markdown new file mode 100644 index 00000000..cbc4b081 --- /dev/null +++ b/doc/site/core/system.markdown @@ -0,0 +1,43 @@ +^title System Class +^category core + +The System class is a grab-bag of functionality exposed by the VM, mostly for +use during development or debugging. + +## Static Methods + +### System.**print**() + +Prints a single newline to the console. + +### System.**print**(object) + +Prints [object] to the console followed by a newline. If not already a string, +the object is converted to a string by calling `toString` on it. + + :::dart + System.print("I like bananas") // Prints "I like bananas". + +### System.**printAll**(sequence) + +Iterates over [sequence] and prints each element, then prints a single newline +at the end. Each element is converted to a string by calling `toString` on it. + + :::dart + System.printAll([1, [2, 3], 4]) // Prints "1[2, 3]4". + +### System.**write**(object) + +Prints a single value to the console, but does not print a newline character +afterwards. Converts the value to a string by calling `toString` on it. + + :::dart + System.write(4 + 5) // Prints "9". + +In the above example, the result of `4 + 5` is printed, and then the prompt is +printed on the same line because no newline character was printed afterwards. + +### System.**clock** + +Returns the number of seconds (including fractional seconds) since the program +was started. This is usually used for benchmarking. diff --git a/doc/site/embedding-api.markdown b/doc/site/embedding-api.markdown index 2a7cb0a4..cb09a721 100644 --- a/doc/site/embedding-api.markdown +++ b/doc/site/embedding-api.markdown @@ -70,7 +70,7 @@ You can tell the VM to execute a string of Wren source code like so: :::c WrenInterpretResult result = wrenInterpret(vm, "", - "IO.print(\"Hi!\")"); + "System.print(\"Hi!\")"); The first string parameter is a "source path". It's just an arbitrary string that describes where the source code is from. It's what shows up in stack traces if a runtime error occurs in the code. It can be whatever you want as long as it's not `NULL`. diff --git a/doc/site/error-handling.markdown b/doc/site/error-handling.markdown index e0271e8a..b852ff86 100644 --- a/doc/site/error-handling.markdown +++ b/doc/site/error-handling.markdown @@ -108,7 +108,7 @@ For example, if you run this program: } var error = fiber.try() - IO.print("Caught error: ", error) + System.print("Caught error: " + error) It prints: @@ -120,7 +120,7 @@ usual. When a fiber has been aborted because of a runtime error, you can also get the error from the fiber object. Continuing the above example: :::dart - IO.print(fiber.error) + System.print(fiber.error) This also prints: diff --git a/doc/site/expressions.markdown b/doc/site/expressions.markdown index a7a84abb..e083fda6 100644 --- a/doc/site/expressions.markdown +++ b/doc/site/expressions.markdown @@ -29,7 +29,7 @@ Wren is object-oriented, so most code consists of method calls. Most of them look like so: :::dart - IO.print("hello") + System.print("hello") items.add("another") items.insert(1, "value") @@ -61,7 +61,7 @@ argument](functions.html#block-arguments): :::dart blondie.callMeAt(867, 5309) { - IO.print("This is the body!") + System.print("This is the body!") } Semantically, all method calls work like so: @@ -98,7 +98,7 @@ call: :::dart class Base { method { - IO.print("base method") + System.print("base method") } } @@ -114,7 +114,7 @@ base class constructor: :::dart class Base { this new(arg) { - IO.print("base constructor got ", arg) + System.print("base constructor got " + arg) } } @@ -218,16 +218,16 @@ A `&&` ("logical and") expression evaluates the left-hand argument. If it's and returns the right-hand argument. :::dart - IO.print(false && 1) // false - IO.print(1 && 2) // 2 + System.print(false && 1) // false + System.print(1 && 2) // 2 An `||` ("logical or") expression is reversed. If the left-hand argument is [true](control-flow.html#truth), it's returned, otherwise the right-hand argument is evaluated and returned: :::dart - IO.print(false || 1) // 1 - IO.print(1 || 2) // 1 + System.print(false || 1) // 1 + System.print(1 || 2) // 1 ## The conditional operator `?:` @@ -236,7 +236,7 @@ the little "if statement in the form of an expression" you know and love from C and its brethren. :::dart - IO.print(1 != 2 ? "math is sane" : "math is not sane!") + System.print(1 != 2 ? "math is sane" : "math is not sane!") It takes a condition expression, followed by `?`, followed by a then expression, a `:`, then an else expression. Just like `if`, it evaluates the diff --git a/doc/site/fibers.markdown b/doc/site/fibers.markdown index addd8c93..b1899a6e 100644 --- a/doc/site/fibers.markdown +++ b/doc/site/fibers.markdown @@ -28,7 +28,7 @@ using the `Fiber` class's constructor: :::dart var fiber = Fiber.new { - IO.print("This runs in a separate fiber.") + System.print("This runs in a separate fiber.") } Creating a fiber does not immediately run it. It's just a first class bundle of @@ -48,7 +48,7 @@ until it passes control to another fiber. If it reaches the end of its body, it's considered *done*: :::dart - var fiber = Fiber.new { IO.print("Hi") } + var fiber = Fiber.new { System.print("Hi") } fiber.isDone // false fiber.call() fiber.isDone // true @@ -71,16 +71,16 @@ You can make a fiber yield by calling the static `yield()` method on `Fiber`: :::dart var fiber = Fiber.new { - IO.print("fiber 1") + System.print("fiber 1") Fiber.yield() - IO.print("fiber 2") + System.print("fiber 2") } - IO.print("main 1") + System.print("main 1") fiber.call() - IO.print("main 2") + System.print("main 2") fiber.call() - IO.print("main 3") + System.print("main 3") This program prints: @@ -105,7 +105,7 @@ of the `yield()` call: :::dart var fiber = Fiber.new { var result = Fiber.yield() - IO.print(result) + System.print(result) } fiber.call("discarded") @@ -124,7 +124,7 @@ invoke the fiber: Fiber.yield("sent") } - IO.print(fiber.call()) + System.print(fiber.call()) This also prints "sent". diff --git a/doc/site/functions.markdown b/doc/site/functions.markdown index 6d753fb1..85bf6f4c 100644 --- a/doc/site/functions.markdown +++ b/doc/site/functions.markdown @@ -22,7 +22,7 @@ a method. At its simplest, it looks like this: :::dart blondie.callMe { - IO.print("This is the body!") + System.print("This is the body!") } Here we're invoking the `callMe` method on `blondie`. We're passing one @@ -44,7 +44,7 @@ the block just like a regular argument list. For example: :::dart blondie.callMeAt(867, 5309) { - IO.print("This is the body!") + System.print("This is the body!") } Of course, you don't *have* to use a block argument to pass a function to a @@ -62,7 +62,7 @@ class's constructor: :::dart var someFn = Fn.new { - IO.print("Hi!") + System.print("Hi!") } As you can see it takes a block argument too! All the constructor does it @@ -87,7 +87,7 @@ method is dynamically-dispatched like any other, so you can define your own :::dart class FakeFn { call() { - IO.print("I'm feeling functional!") + System.print("I'm feeling functional!") } } @@ -102,7 +102,7 @@ of the body, like so: :::dart blondie.callMe {|first, last| - IO.print("Hi, " + first + " " + last + "!") + System.print("Hi, " + first + " " + last + "!") } Here we're passing a function to `greet` that takes two parameters, `first` and @@ -157,6 +157,6 @@ to`i`: :::dart var counter = Counter.create - IO.print(counter.call()) // Prints "1". - IO.print(counter.call()) // Prints "2". - IO.print(counter.call()) // Prints "3". + System.print(counter.call()) // Prints "1". + System.print(counter.call()) // Prints "2". + System.print(counter.call()) // Prints "3". diff --git a/doc/site/getting-started.markdown b/doc/site/getting-started.markdown index ecf22793..5b1fedc3 100644 --- a/doc/site/getting-started.markdown +++ b/doc/site/getting-started.markdown @@ -49,12 +49,12 @@ interactive mode. You can type in a line of code, and it will immediately execute it. Here's something to try: :::dart - IO.print("Hello, world!") + System.print("Hello, world!") Or a little more exciting: :::dart - for (i in 1..10) IO.print("Counting up ", i) + for (i in 1..10) System.print("Counting up " + i.toString) You can exit the interpreter using good old Ctrl-C or Ctrl-D, or just throw your computer to the ground and storm off. @@ -80,10 +80,10 @@ your favorite text editor and paste this into it: y0 = y1 iter = iter + 1 } - IO.write(" .-:;+=xX$& "[iter]) + System.write(" .-:;+=xX$& "[iter]) } - IO.print("") + System.print("") } Now run: diff --git a/doc/site/index.markdown b/doc/site/index.markdown index 9df5669c..e6ecc716 100644 --- a/doc/site/index.markdown +++ b/doc/site/index.markdown @@ -6,11 +6,11 @@ Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a familiar, modern [syntax][]. :::dart - IO.print("Hello, world!") + System.print("Hello, world!") class Wren { flyTo(city) { - IO.print("Flying to ", city) + System.print("Flying to " + city) } } @@ -18,7 +18,7 @@ a familiar, modern [syntax][]. ["small", "clean", "fast"].each {|word| Fiber.yield(word) } } - while (!adjectives.isDone) IO.print(adjectives.call()) + while (!adjectives.isDone) System.print(adjectives.call()) * **Wren is small.** The VM implementation is under [4,000 semicolons][src]. You can skim the whole thing in an afternoon. It's *small*, but not diff --git a/doc/site/lists.markdown b/doc/site/lists.markdown index 5b71a8fc..42a3cb7d 100644 --- a/doc/site/lists.markdown +++ b/doc/site/lists.markdown @@ -59,14 +59,14 @@ existing element in the list using the subscript setter: :::dart hirsute[1] = "muttonchops" - IO.print(hirsute[1]) // muttonchops. + System.print(hirsute[1]) // muttonchops. It's an error to set an element that's out of bounds. To grow a list, you can use `add` to append a single item to the end: :::dart hirsute.add("goatee") - IO.print(hirsute.count) // 4. + System.print(hirsute.count) // 4. You can insert a new element at a specific position using `insert`: @@ -84,9 +84,9 @@ back. Doing so counts back from the size of the list *after* it's grown by one: :::dart var letters = ["a", "b", "c"] letters.insert(3, "d") // OK: inserts at end. - IO.print(letters) // ["a", "b", "c", "d"] + System.print(letters) // ["a", "b", "c", "d"] letters.insert(-2, "e") // Counts back from size after insert. - IO.print(letters) // ["a", "b", "c", "e", "d"] + System.print(letters) // ["a", "b", "c", "e", "d"] ## Removing elements @@ -97,15 +97,15 @@ gap: :::dart var letters = ["a", "b", "c", "d"] letters.removeAt(1) - IO.print(letters) // ["a", "c", "d"] + System.print(letters) // ["a", "c", "d"] The `removeAt` method returns the removed item: :::dart - IO.print(letters.removeAt(1)) // "c" + System.print(letters.removeAt(1)) // "c" If you want to remove everything from the list, you can clear it: :::dart hirsute.clear() - IO.print(hirsute) // [] + System.print(hirsute) // [] diff --git a/doc/site/maps.markdown b/doc/site/maps.markdown index b3924868..1b79e7c5 100644 --- a/doc/site/maps.markdown +++ b/doc/site/maps.markdown @@ -58,7 +58,7 @@ To find the value associated with some key, again you use your friend the subscript operator: :::dart - IO.print(capitals["Idaho"]) // "Boise". + System.print(capitals["Idaho"]) // "Boise". If the key is present, this returns its value. Otherwise, it returns `null`. Of course, `null` itself can also be used as a value, so seeing `null` here @@ -69,15 +69,15 @@ To tell definitively if a key exists, you can call `containsKey()`: :::dart var belief = {"nihilism": null} - IO.print(belief["nihilism"]) // "null" though key exists. - IO.print(belief["solipsism"]) // Also "null". - IO.print(belief.containsKey("nihilism")) // "true". - IO.print(belief.containsKey("solipsism")) // "false". + System.print(belief["nihilism"]) // "null" though key exists. + System.print(belief["solipsism"]) // Also "null". + System.print(belief.containsKey("nihilism")) // "true". + System.print(belief.containsKey("solipsism")) // "false". You can see how many entries a map contains using `count`: :::dart - IO.print(capitals.count) // "3". + System.print(capitals.count) // "3". ## Removing entries @@ -86,12 +86,12 @@ entry you want to delete: :::dart capitals.remove("Maine") - IO.print(capitals.containsKey("Maine")) // "false". + System.print(capitals.containsKey("Maine")) // "false". If the key was found, this returns the value that was associated with it: :::dart - IO.print(capitals.remove("Georgia")) // "Atlanta". + System.print(capitals.remove("Georgia")) // "Atlanta". If the key wasn't in the map to begin with, `remove()` just returns `null`. @@ -100,7 +100,7 @@ can just call `clear()`: :::dart capitals.clear() - IO.print(capitals.count) // "0". + System.print(capitals.count) // "0". [lists]: lists.html @@ -120,14 +120,14 @@ If you want to see all of the key-value pairs in a map, the easiest way is to iterate over the keys and use each to look up its value: :::dart - var stateBirds = { + var birds = { "Arizona": "Cactus wren", "Hawaii": "Nēnē", "Ohio": "Northern Cardinal" } - for (state in stateBirds.keys) { - IO.print("The state bird of ", state, " is ", stateBirds[state]) + for (state in birds.keys) { + System.print("The state bird of " + state + " is " + birds[state]) } This program will print the three states and their birds. However, the *order* diff --git a/doc/site/modules.markdown b/doc/site/modules.markdown index ce18899b..44402398 100644 --- a/doc/site/modules.markdown +++ b/doc/site/modules.markdown @@ -173,7 +173,7 @@ like: import "shared" // shared.wren - IO.print("Shared!") + System.print("Shared!") Here, "a" and "b" both want to use "shared". If "shared" defines some top-level state, we only want a single copy of that in memory. To handle this, a module's @@ -211,14 +211,14 @@ For example: import "a" // a.wren - IO.print("start a") + System.print("start a") import "b" - IO.print("end a") + System.print("end a") // b.wren - IO.print("start b") + System.print("start b") import "a" - IO.print("end b") + System.print("end b") This program runs successfully and prints: diff --git a/doc/site/syntax.markdown b/doc/site/syntax.markdown index 00f0b748..7c891237 100644 --- a/doc/site/syntax.markdown +++ b/doc/site/syntax.markdown @@ -54,15 +54,15 @@ Newlines (`\n`) are meaningful in Wren. They are used to separate statements: :::dart // Two statements: - IO.print("hi") // Newline. - IO.print("bye") + System.print("hi") // Newline. + System.print("bye") Sometimes, though, a statement doesn't fit on a single line and jamming a newline in the middle would trip it up. To handle that, Wren has a very simple rule: It ignores a newline following any token that can't end a statement. :::dart - IO.print( // Newline here is ignored. + System.print( // Newline here is ignored. "hi") In practice, this means you can put each statement on its own line and wrap @@ -79,16 +79,16 @@ statement for the else: :::dart if (happy && knowIt) { hands.clap - } else IO.print("sad") + } else System.print("sad") Blocks have two similar but not identical forms. Typically, blocks contain a series of statements like: :::dart { - IO.print("one") - IO.print("two") - IO.print("three") + System.print("one") + System.print("two") + System.print("three") } Blocks of this form when used for method and function bodies automatically diff --git a/doc/site/template-core.html b/doc/site/template-core.html index 0476d5b1..31d8d958 100644 --- a/doc/site/template-core.html +++ b/doc/site/template-core.html @@ -38,7 +38,7 @@
  • Range
  • Sequence
  • String
  • -
  • IO
  • +
  • System
  • diff --git a/doc/site/values.markdown b/doc/site/values.markdown index a50c01c8..14855239 100644 --- a/doc/site/values.markdown +++ b/doc/site/values.markdown @@ -57,11 +57,11 @@ A handful of escape characters are supported: A `\u` followed by four hex digits can be used to specify a Unicode code point: :::dart - IO.print("\u0041\u0b83\u00DE") // "AஃÞ" + System.print("\u0041\u0b83\u00DE") // "AஃÞ" A `\x` followed by two hex digits specifies a single unencoded byte: - IO.print("\x48\x69\x2e") // "Hi." + System.print("\x48\x69\x2e") // "Hi." Strings are instances of class [String](core/string.html). @@ -90,7 +90,7 @@ example: :::dart var list = ["a", "b", "c", "d", "e"] var slice = list[1..3] - IO.print(slice) // ["b", "c", "d"] + System.print(slice) // ["b", "c", "d"] Their class is [Range](core/range.html). diff --git a/doc/site/variables.markdown b/doc/site/variables.markdown index 1cd1d4d9..e1ee5020 100644 --- a/doc/site/variables.markdown +++ b/doc/site/variables.markdown @@ -13,7 +13,7 @@ defined, it can be accessed by name as you would expect. :::dart var animal = "Slow Loris" - IO.print(animal) // Prints "Slow Loris". + System.print(animal) // Prints "Slow Loris". ## Scope @@ -22,11 +22,11 @@ until the end of the [block](syntax.html#blocks) where that definition appears. :::dart { - IO.print(a) // ERROR! a doesn't exist yet. + System.print(a) // ERROR! a doesn't exist yet. var a = 123 - IO.print(a) // "123" + System.print(a) // "123" } - IO.print(a) // ERROR! a doesn't exist anymore. + System.print(a) // ERROR! a doesn't exist anymore. Variables defined at the top level of a script are *top-level* and are visible to the [module](modules.html) system. All other variables are *local*. @@ -38,9 +38,9 @@ intend to do much). var a = "outer" { var a = "inner" - IO.print(a) // Prints "inner". + System.print(a) // Prints "inner". } - IO.print(a) // Prints "outer". + System.print(a) // Prints "outer". Declaring a variable with the same name in the *same* scope *is* an error. @@ -65,6 +65,6 @@ assigned value. :::dart var a = "before" - IO.print(a = "after") // Prints "after". + System.print(a = "after") // Prints "after". **TODO: Top-level names.** diff --git a/example/hello.wren b/example/hello.wren index 0bb440c3..3cfadf03 100644 --- a/example/hello.wren +++ b/example/hello.wren @@ -1 +1 @@ -IO.print("Hello, world!") +System.print("Hello, world!") diff --git a/example/import-module/lovecraft.wren b/example/import-module/lovecraft.wren index 728c081a..57b11331 100644 --- a/example/import-module/lovecraft.wren +++ b/example/import-module/lovecraft.wren @@ -5,4 +5,4 @@ class Lovecraft { say() { Cthulu.new().message } } -IO.print(Lovecraft.new().say()) +System.print(Lovecraft.new().say()) diff --git a/example/mandelbrot.wren b/example/mandelbrot.wren index 31bc86c0..89cf5a17 100644 --- a/example/mandelbrot.wren +++ b/example/mandelbrot.wren @@ -29,8 +29,8 @@ for (yPixel in 0...24) { } } - IO.write(pixel) + System.write(pixel) } - IO.print("") -} \ No newline at end of file + System.print() +} diff --git a/example/sokoban.wren b/example/sokoban.wren deleted file mode 100644 index 0bb440c3..00000000 --- a/example/sokoban.wren +++ /dev/null @@ -1 +0,0 @@ -IO.print("Hello, world!") diff --git a/example/syntax.wren b/example/syntax.wren index affd4462..52d440f5 100644 --- a/example/syntax.wren +++ b/example/syntax.wren @@ -9,7 +9,7 @@ class SyntaxExample { // Constructor construct new() { // Top-level name `IO` - IO.print("I am a constructor!") + System.print("I am a constructor!") // Method calls variables @@ -58,7 +58,7 @@ class SyntaxExample { field=(value) { _field = value } // Method with arguments - print(a, b) { IO.print(a + b) } + print(a, b) { System.print(a + b) } // Operators +(other) { "infix + " + other } @@ -97,7 +97,7 @@ class ReservedWords is SyntaxExample { // `for`, `in` for (beatle in ["george", "john", "paul", "ringo"]) { - IO.print(beatle) + System.print(beatle) // `break` break } @@ -147,9 +147,9 @@ class Literals is SyntaxExample { "\t" // Tab. "\v" // Vertical tab. // Unicode code points - IO.print("\u0041fgdg\u0b83\u00DE") // "AஃÞ" + System.print("\u0041fgdg\u0b83\u00DE") // "AஃÞ" // Unencoded bytes - IO.print("\x48\x69\x2e") // "Hi." + System.print("\x48\x69\x2e") // "Hi." } ranges { diff --git a/project/xcode/wren.xcodeproj/project.pbxproj b/project/xcode/wren.xcodeproj/project.pbxproj index 5e493348..678282b8 100644 --- a/project/xcode/wren.xcodeproj/project.pbxproj +++ b/project/xcode/wren.xcodeproj/project.pbxproj @@ -17,7 +17,6 @@ 29205C991AB4E6430073018D /* wren_compiler.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C921AB4E6430073018D /* wren_compiler.c */; }; 29205C9A1AB4E6430073018D /* wren_core.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C931AB4E6430073018D /* wren_core.c */; }; 29205C9B1AB4E6430073018D /* wren_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C941AB4E6430073018D /* wren_debug.c */; }; - 29205C9C1AB4E6430073018D /* wren_io.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C951AB4E6430073018D /* wren_io.c */; }; 29205C9D1AB4E6430073018D /* wren_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C961AB4E6430073018D /* wren_utils.c */; }; 29205C9E1AB4E6430073018D /* wren_value.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C971AB4E6430073018D /* wren_value.c */; }; 29205C9F1AB4E6430073018D /* wren_vm.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C981AB4E6430073018D /* wren_vm.c */; }; @@ -63,7 +62,6 @@ 29205C921AB4E6430073018D /* wren_compiler.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = wren_compiler.c; path = ../../src/vm/wren_compiler.c; sourceTree = ""; }; 29205C931AB4E6430073018D /* wren_core.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = wren_core.c; path = ../../src/vm/wren_core.c; sourceTree = ""; }; 29205C941AB4E6430073018D /* wren_debug.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = wren_debug.c; path = ../../src/vm/wren_debug.c; sourceTree = ""; }; - 29205C951AB4E6430073018D /* wren_io.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = wren_io.c; path = ../../src/vm/wren_io.c; sourceTree = ""; }; 29205C961AB4E6430073018D /* wren_utils.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = wren_utils.c; path = ../../src/vm/wren_utils.c; sourceTree = ""; }; 29205C971AB4E6430073018D /* wren_value.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = wren_value.c; path = ../../src/vm/wren_value.c; sourceTree = ""; }; 29205C981AB4E6430073018D /* wren_vm.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = wren_vm.c; path = ../../src/vm/wren_vm.c; sourceTree = ""; }; @@ -71,7 +69,6 @@ 29205CA21AB4E65E0073018D /* wren_compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_compiler.h; path = ../../src/vm/wren_compiler.h; sourceTree = ""; }; 29205CA31AB4E65E0073018D /* wren_core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_core.h; path = ../../src/vm/wren_core.h; sourceTree = ""; }; 29205CA41AB4E65E0073018D /* wren_debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_debug.h; path = ../../src/vm/wren_debug.h; sourceTree = ""; }; - 29205CA51AB4E65E0073018D /* wren_io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_io.h; path = ../../src/vm/wren_io.h; sourceTree = ""; }; 29205CA61AB4E65E0073018D /* wren_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_utils.h; path = ../../src/vm/wren_utils.h; sourceTree = ""; }; 29205CA71AB4E65E0073018D /* wren_value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_value.h; path = ../../src/vm/wren_value.h; sourceTree = ""; }; 29205CA81AB4E65E0073018D /* wren_vm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_vm.h; path = ../../src/vm/wren_vm.h; sourceTree = ""; }; @@ -137,8 +134,6 @@ 29205C931AB4E6430073018D /* wren_core.c */, 29205CA41AB4E65E0073018D /* wren_debug.h */, 29205C941AB4E6430073018D /* wren_debug.c */, - 29205CA51AB4E65E0073018D /* wren_io.h */, - 29205C951AB4E6430073018D /* wren_io.c */, 29DE39521AC3A50A00987D41 /* wren_meta.h */, 29DE39511AC3A50A00987D41 /* wren_meta.c */, 296371B31AC713D000079FDA /* wren_opcodes.h */, @@ -292,7 +287,6 @@ 29C8A9331AB71FFF00DEC81D /* vm.c in Sources */, 291647C41BA5EA45006142EE /* scheduler.c in Sources */, 29205C9B1AB4E6430073018D /* wren_debug.c in Sources */, - 29205C9C1AB4E6430073018D /* wren_io.c in Sources */, 29205C9D1AB4E6430073018D /* wren_utils.c in Sources */, 29205C9E1AB4E6430073018D /* wren_value.c in Sources */, 29205C9F1AB4E6430073018D /* wren_vm.c in Sources */, diff --git a/script/test.py b/script/test.py index 4c44bfdf..9b922c6c 100755 --- a/script/test.py +++ b/script/test.py @@ -14,7 +14,7 @@ WREN_DIR = dirname(dirname(realpath(__file__))) WREN_APP = join(WREN_DIR, 'bin', 'wrend') TEST_APP = join(WREN_DIR, 'build', 'debug', 'test', 'wrend') -EXPECT_PATTERN = re.compile(r'// expect: (.*)') +EXPECT_PATTERN = re.compile(r'// expect: ?(.*)') EXPECT_ERROR_PATTERN = re.compile(r'// expect error(?! line)') EXPECT_ERROR_LINE_PATTERN = re.compile(r'// expect error line (\d+)') EXPECT_RUNTIME_ERROR_PATTERN = re.compile(r'// expect runtime error: (.+)') diff --git a/src/vm/wren_common.h b/src/vm/wren_common.h index 834f7eb8..491a8ad1 100644 --- a/src/vm/wren_common.h +++ b/src/vm/wren_common.h @@ -44,13 +44,6 @@ #endif #endif -// If true, loads the "IO" class in the standard library. -// -// Defaults to on. -#ifndef WREN_USE_LIB_IO - #define WREN_USE_LIB_IO 1 -#endif - // If true, loads the "Meta" class in the standard library. // // Defaults to on. diff --git a/src/vm/wren_core.c b/src/vm/wren_core.c index 3bd48e24..55503075 100644 --- a/src/vm/wren_core.c +++ b/src/vm/wren_core.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "wren_common.h" #include "wren_core.h" @@ -1041,6 +1042,17 @@ DEF_PRIMITIVE(string_toString) RETURN_VAL(args[0]); } +DEF_PRIMITIVE(system_clock) +{ + RETURN_NUM((double)clock() / CLOCKS_PER_SEC); +} + +DEF_PRIMITIVE(system_writeString) +{ + printf("%s", AS_CSTRING(args[1])); + RETURN_VAL(args[1]); +} + // Creates either the Object or Class class in the core library with [name]. static ObjClass* defineClass(WrenVM* vm, ObjModule* module, const char* name) { @@ -1254,6 +1266,10 @@ void wrenInitializeCore(WrenVM* vm) PRIMITIVE(vm->rangeClass, "iteratorValue(_)", range_iteratorValue); PRIMITIVE(vm->rangeClass, "toString", range_toString); + ObjClass* systemClass = AS_CLASS(wrenFindVariable(vm, coreModule, "System")); + PRIMITIVE(systemClass->obj.classObj, "clock", system_clock); + PRIMITIVE(systemClass->obj.classObj, "writeString_(_)", system_writeString); + // While bootstrapping the core types and running the core library, a number // of string objects have been created, many of which were instantiated // before stringClass was stored in the VM. Some of them *must* be created diff --git a/src/vm/wren_core.wren.inc b/src/vm/wren_core.wren.inc index 96ff3a16..e9c42ffa 100644 --- a/src/vm/wren_core.wren.inc +++ b/src/vm/wren_core.wren.inc @@ -214,4 +214,39 @@ static const char* coreModuleSource = " iteratorValue(iterator) { _map.valueIteratorValue_(iterator) }\n" "}\n" "\n" -"class Range is Sequence {}\n"; +"class Range is Sequence {}\n" +"\n" +"class System {\n" +" static print() {\n" +" writeString_(\"\n\")\n" +" }\n" +"\n" +" static print(obj) {\n" +" writeObject_(obj)\n" +" writeString_(\"\n\")\n" +" return obj\n" +" }\n" +"\n" +" static printAll(sequence) {\n" +" for (object in sequence) writeObject_(object)\n" +" writeString_(\"\n\")\n" +" }\n" +"\n" +" static write(obj) {\n" +" writeObject_(obj)\n" +" return obj\n" +" }\n" +"\n" +" static writeAll(sequence) {\n" +" for (object in sequence) writeObject_(object)\n" +" }\n" +"\n" +" static writeObject_(obj) {\n" +" var string = obj.toString\n" +" if (string is String) {\n" +" writeString_(string)\n" +" } else {\n" +" writeString_(\"[invalid toString]\")\n" +" }\n" +" }\n" +"}\n"; diff --git a/src/vm/wren_io.c b/src/vm/wren_io.c deleted file mode 100644 index 1b0201fd..00000000 --- a/src/vm/wren_io.c +++ /dev/null @@ -1,59 +0,0 @@ -#include "wren_io.h" - -#if WREN_USE_LIB_IO - -#include -#include -#include - -// TODO: This is an arbitrary limit. Do something smarter. -#define MAX_READ_LEN 1024 - -#include "wren_io.wren.inc" - -static void ioWriteString(WrenVM* vm) -{ - const char* s = wrenGetArgumentString(vm, 1); - // TODO: Check for null. - printf("%s", s); -} - -static void ioRead(WrenVM* vm) -{ - char buffer[MAX_READ_LEN]; - char* result = fgets(buffer, MAX_READ_LEN, stdin); - - if (result != NULL) - { - wrenReturnString(vm, buffer, (int)strlen(buffer)); - } -} - -static void ioClock(WrenVM* vm) -{ - wrenReturnDouble(vm, (double)clock() / CLOCKS_PER_SEC); -} - -static void ioTime(WrenVM* vm) -{ - wrenReturnDouble(vm, (double)time(NULL)); -} - -void wrenLoadIOLibrary(WrenVM* vm) -{ - wrenInterpret(vm, "", ioModuleSource); -} - -WrenForeignMethodFn wrenBindIOForeignMethod(WrenVM* vm, const char* className, - const char* signature) -{ - if (strcmp(className, "IO") != 0) return NULL; - - if (strcmp(signature, "writeString_(_)") == 0) return ioWriteString; - if (strcmp(signature, "clock") == 0) return ioClock; - if (strcmp(signature, "time") == 0) return ioTime; - if (strcmp(signature, "read()") == 0) return ioRead; - return NULL; -} - -#endif diff --git a/src/vm/wren_io.h b/src/vm/wren_io.h deleted file mode 100644 index 4c052b64..00000000 --- a/src/vm/wren_io.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef wren_io_h -#define wren_io_h - -#include "wren.h" -#include "wren_common.h" - -// This module defines the IO class and its associated methods. They are -// implemented using the C standard library. -#if WREN_USE_LIB_IO - -void wrenLoadIOLibrary(WrenVM* vm); - -WrenForeignMethodFn wrenBindIOForeignMethod(WrenVM* vm, const char* className, - const char* signature); - -#endif - -#endif diff --git a/src/vm/wren_io.wren.inc b/src/vm/wren_io.wren.inc deleted file mode 100644 index d9ced63d..00000000 --- a/src/vm/wren_io.wren.inc +++ /dev/null @@ -1,103 +0,0 @@ -// Generated automatically from builtin/io.wren. Do not edit. -static const char* ioModuleSource = -"class IO {\n" -" static print {\n" -" writeString_(\"\n\")\n" -" }\n" -"\n" -" static print(obj) {\n" -" writeObject_(obj)\n" -" writeString_(\"\n\")\n" -" return obj\n" -" }\n" -"\n" -" static print(a1, a2) {\n" -" printAll([a1, a2])\n" -" }\n" -"\n" -" static print(a1, a2, a3) {\n" -" printAll([a1, a2, a3])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4) {\n" -" printAll([a1, a2, a3, a4])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5) {\n" -" printAll([a1, a2, a3, a4, a5])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6) {\n" -" printAll([a1, a2, a3, a4, a5, a6])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6, a7) {\n" -" printAll([a1, a2, a3, a4, a5, a6, a7])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6, a7, a8) {\n" -" printAll([a1, a2, a3, a4, a5, a6, a7, a8])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6, a7, a8, a9) {\n" -" printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {\n" -" printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) {\n" -" printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) {\n" -" printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) {\n" -" printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14) {\n" -" printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) {\n" -" printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15])\n" -" }\n" -"\n" -" static print(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) {\n" -" printAll([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16])\n" -" }\n" -"\n" -" static printAll(sequence) {\n" -" for (object in sequence) writeObject_(object)\n" -" writeString_(\"\n\")\n" -" }\n" -"\n" -" static write(obj) {\n" -" writeObject_(obj)\n" -" return obj\n" -" }\n" -"\n" -" static read(prompt) {\n" -" if (!(prompt is String)) Fiber.abort(\"Prompt must be a string.\")\n" -" write(prompt)\n" -" return read()\n" -" }\n" -"\n" -" static writeObject_(obj) {\n" -" var string = obj.toString\n" -" if (string is String) {\n" -" writeString_(string)\n" -" } else {\n" -" writeString_(\"[invalid toString]\")\n" -" }\n" -" }\n" -"\n" -" foreign static writeString_(string)\n" -" foreign static clock\n" -" foreign static time\n" -" foreign static read()\n" -"}\n"; diff --git a/src/vm/wren_vm.c b/src/vm/wren_vm.c index 6aefa3ee..717050a2 100644 --- a/src/vm/wren_vm.c +++ b/src/vm/wren_vm.c @@ -298,20 +298,6 @@ static WrenForeignMethodFn findForeignMethod(WrenVM* vm, bool isStatic, const char* signature) { - WrenForeignMethodFn fn; - - // Bind foreign methods in the core module. - if (strcmp(moduleName, "core") == 0) - { - #if WREN_USE_LIB_IO - fn = wrenBindIOForeignMethod(vm, className, signature); - #endif - - ASSERT(fn != NULL, "Failed to bind core module foreign method."); - return fn; - } - - // For other modules, let the host bind it. if (vm->bindForeignMethod == NULL) return NULL; return vm->bindForeignMethod(vm, moduleName, className, isStatic, signature); diff --git a/test/README.md b/test/README.md index 9652fa8e..bb090509 100644 --- a/test/README.md +++ b/test/README.md @@ -8,9 +8,6 @@ This contains the automated validation suite for the VM and built-in libraries. classes. If a bug is in `wren_core.c` or `wren_value.c`, it will most likely break one of these tests. -* `io/` - Tests for the built in IO library. In other words, methods on the - `IO` class. If a bug is in `wren_io.c`, it should break one of these tests. - * `language/` - Tests of the language itself, its grammar and runtime semantics. If a bug is in `wren_compiler.c` or `wren_vm.c`, it will most likely break one of these tests. This includes tests for the syntax for the diff --git a/test/api/foreign_class.wren b/test/api/foreign_class.wren index 03889f4d..b3affda0 100644 --- a/test/api/foreign_class.wren +++ b/test/api/foreign_class.wren @@ -11,27 +11,27 @@ foreign class Counter { } var counter = Counter.new() -IO.print(counter.value) // expect: 0 +System.print(counter.value) // expect: 0 counter.increment(3.1) -IO.print(counter.value) // expect: 3.1 +System.print(counter.value) // expect: 3.1 counter.increment(1.2) -IO.print(counter.value) // expect: 4.3 +System.print(counter.value) // expect: 4.3 // Foreign classes can inherit a class as long as it has no fields. class PointBase { inherited() { - IO.print("inherited method") + System.print("inherited method") } } // Class with non-default constructor. foreign class Point is PointBase { construct new() { - IO.print("default") + System.print("default") } construct new(x, y, z) { - IO.print(x, ", ", y, ", ", z) + System.print(x.toString + ", " + y.toString + ", " + z.toString) } foreign translate(x, y, z) @@ -39,19 +39,19 @@ foreign class Point is PointBase { } var p = Point.new(1, 2, 3) // expect: 1, 2, 3 -IO.print(p) // expect: (1, 2, 3) +System.print(p) // expect: (1, 2, 3) p.translate(3, 4, 5) -IO.print(p) // expect: (4, 6, 8) +System.print(p) // expect: (4, 6, 8) p = Point.new() // expect: default -IO.print(p) // expect: (0, 0, 0) +System.print(p) // expect: (0, 0, 0) p.inherited() // expect: inherited method var error = Fiber.new { class Subclass is Point {} }.try() -IO.print(error) // expect: Class 'Subclass' cannot inherit from foreign class 'Point'. +System.print(error) // expect: Class 'Subclass' cannot inherit from foreign class 'Point'. // Class with a finalizer. foreign class Resource { @@ -65,14 +65,14 @@ var resources = [ ] Api.gc() -IO.print(Api.finalized) // expect: 0 +System.print(Api.finalized) // expect: 0 resources.removeAt(-1) Api.gc() -IO.print(Api.finalized) // expect: 1 +System.print(Api.finalized) // expect: 1 resources.clear() Api.gc() -IO.print(Api.finalized) // expect: 3 +System.print(Api.finalized) // expect: 3 diff --git a/test/api/returns.wren b/test/api/returns.wren index f607eef6..dade69ec 100644 --- a/test/api/returns.wren +++ b/test/api/returns.wren @@ -8,10 +8,10 @@ class Api { foreign static returnFalse } -IO.print(Api.implicitNull == null) // expect: true +System.print(Api.implicitNull == null) // expect: true -IO.print(Api.returnInt) // expect: 123456 -IO.print(Api.returnFloat) // expect: 123.456 +System.print(Api.returnInt) // expect: 123456 +System.print(Api.returnFloat) // expect: 123.456 -IO.print(Api.returnTrue) // expect: true -IO.print(Api.returnFalse) // expect: false +System.print(Api.returnTrue) // expect: true +System.print(Api.returnFalse) // expect: false diff --git a/test/api/value.wren b/test/api/value.wren index e3e07d4f..c348869f 100644 --- a/test/api/value.wren +++ b/test/api/value.wren @@ -11,4 +11,4 @@ for (i in 1...10) { s = s + " more" } -IO.print(Api.value) // expect: [list, of, strings] +System.print(Api.value) // expect: [list, of, strings] diff --git a/test/benchmark/binary_trees.wren b/test/benchmark/binary_trees.wren index 3bf44d03..05028c06 100644 --- a/test/benchmark/binary_trees.wren +++ b/test/benchmark/binary_trees.wren @@ -24,10 +24,10 @@ var minDepth = 4 var maxDepth = 12 var stretchDepth = maxDepth + 1 -var start = IO.clock +var start = System.clock -IO.print("stretch tree of depth ", stretchDepth, " check: ", - Tree.new(0, stretchDepth).check) +System.print("stretch tree of depth " + stretchDepth.toString + " check: " + + Tree.new(0, stretchDepth).check.toString) var longLivedTree = Tree.new(0, maxDepth) @@ -44,10 +44,12 @@ while (depth < stretchDepth) { check = check + Tree.new(i, depth).check + Tree.new(-i, depth).check } - IO.print((iterations * 2), " trees of depth ", depth, " check: ", check) + System.print((iterations * 2).toString + " trees of depth " + + depth.toString + " check: " + check.toString) iterations = iterations / 4 depth = depth + 2 } -IO.print("long lived tree of depth ", maxDepth, " check: ", longLivedTree.check) -IO.print("elapsed: ", (IO.clock - start)) +System.print("long lived tree of depth " + maxDepth.toString + " check: " + + longLivedTree.check.toString) +System.print("elapsed: " + (System.clock - start).toString) diff --git a/test/benchmark/delta_blue.wren b/test/benchmark/delta_blue.wren index 74fafafd..8311bf0a 100644 --- a/test/benchmark/delta_blue.wren +++ b/test/benchmark/delta_blue.wren @@ -92,7 +92,7 @@ class Constraint { chooseMethod(mark) if (!isSatisfied) { if (_strength == REQUIRED) { - IO.print("Could not satisfy a required constraint!") + System.print("Could not satisfy a required constraint!") } return null } @@ -102,7 +102,7 @@ class Constraint { var overridden = out.determinedBy if (overridden != null) overridden.markUnsatisfied out.determinedBy = this - if (!ThePlanner.addPropagate(this, mark)) IO.print("Cycle encountered") + if (!ThePlanner.addPropagate(this, mark)) System.print("Cycle encountered") out.mark = mark return overridden } @@ -669,31 +669,31 @@ var projectionTest = Fn.new {|n| change.call(src, 17) total = total + dst.value - if (dst.value != 1170) IO.print("Projection 1 failed") + if (dst.value != 1170) System.print("Projection 1 failed") change.call(dst, 1050) total = total + src.value - if (src.value != 5) IO.print("Projection 2 failed") + if (src.value != 5) System.print("Projection 2 failed") change.call(scale, 5) for (i in 0...n - 1) { total = total + dests[i].value - if (dests[i].value != i * 5 + 1000) IO.print("Projection 3 failed") + if (dests[i].value != i * 5 + 1000) System.print("Projection 3 failed") } change.call(offset, 2000) for (i in 0...n - 1) { total = total + dests[i].value - if (dests[i].value != i * 5 + 2000) IO.print("Projection 4 failed") + if (dests[i].value != i * 5 + 2000) System.print("Projection 4 failed") } } -var start = IO.clock +var start = System.clock for (i in 0...40) { chainTest.call(100) projectionTest.call(100) } -IO.print(total) -IO.print("elapsed: ", IO.clock - start) +System.print(total) +System.print("elapsed: " + (System.clock - start).toString) diff --git a/test/benchmark/fib.wren b/test/benchmark/fib.wren index 35c89dfb..dcad88f0 100644 --- a/test/benchmark/fib.wren +++ b/test/benchmark/fib.wren @@ -5,8 +5,8 @@ class Fib { } } -var start = IO.clock +var start = System.clock for (i in 1..5) { - IO.print(Fib.get(28)) + System.print(Fib.get(28)) } -IO.print("elapsed: ", IO.clock - start) +System.print("elapsed: " + (System.clock - start).toString) diff --git a/test/benchmark/fibers.wren b/test/benchmark/fibers.wren index 83ff0f79..a30da99c 100644 --- a/test/benchmark/fibers.wren +++ b/test/benchmark/fibers.wren @@ -2,7 +2,7 @@ var fibers = [] var sum = 0 -var start = IO.clock +var start = System.clock for (i in 0...100000) { fibers.add(Fiber.new { @@ -12,5 +12,5 @@ for (i in 0...100000) { } fibers[0].call() -IO.print(sum) -IO.print("elapsed: ", IO.clock - start) +System.print(sum) +System.print("elapsed: " + (System.clock - start).toString) diff --git a/test/benchmark/for.wren b/test/benchmark/for.wren index f76d0041..1546c909 100644 --- a/test/benchmark/for.wren +++ b/test/benchmark/for.wren @@ -1,10 +1,10 @@ var list = [] -var start = IO.clock +var start = System.clock for (i in 0...1000000) list.add(i) var sum = 0 for (i in list) sum = sum + i -IO.print(sum) -IO.print("elapsed: ", IO.clock - start) +System.print(sum) +System.print("elapsed: " + (System.clock - start).toString) diff --git a/test/benchmark/map_numeric.wren b/test/benchmark/map_numeric.wren index b07b5fe2..e6b226a6 100644 --- a/test/benchmark/map_numeric.wren +++ b/test/benchmark/map_numeric.wren @@ -1,4 +1,4 @@ -var start = IO.clock +var start = System.clock var map = {} @@ -10,10 +10,10 @@ var sum = 0 for (i in 1..1000000) { sum = sum + map[i] } -IO.print(sum) +System.print(sum) for (i in 1..1000000) { map.remove(i) } -IO.print("elapsed: ", IO.clock - start) +System.print("elapsed: " + (System.clock - start).toString) diff --git a/test/benchmark/map_string.wren b/test/benchmark/map_string.wren index f0157bf9..b31a4137 100644 --- a/test/benchmark/map_string.wren +++ b/test/benchmark/map_string.wren @@ -77,7 +77,7 @@ for (animal in animals) { } } -var start = IO.clock +var start = System.clock var map = {} @@ -96,5 +96,5 @@ for (key in keys) { map.remove(key) } -IO.print(sum) -IO.print("elapsed: ", IO.clock - start) +System.print(sum) +System.print("elapsed: " + (System.clock - start).toString) diff --git a/test/benchmark/method_call.wren b/test/benchmark/method_call.wren index 71579357..22739e41 100644 --- a/test/benchmark/method_call.wren +++ b/test/benchmark/method_call.wren @@ -28,7 +28,7 @@ class NthToggle is Toggle { } } -var start = IO.clock +var start = System.clock var n = 100000 var val = true var toggle = Toggle.new(val) @@ -46,7 +46,7 @@ for (i in 0...n) { val = toggle.activate.value } -IO.print(toggle.value) +System.print(toggle.value) val = true var ntoggle = NthToggle.new(val, 3) @@ -64,5 +64,5 @@ for (i in 0...n) { val = ntoggle.activate.value } -IO.print(ntoggle.value) -IO.print("elapsed: ", IO.clock - start) +System.print(ntoggle.value) +System.print("elapsed: " + (System.clock - start).toString) diff --git a/test/benchmark/string_equals.wren b/test/benchmark/string_equals.wren index 52aea3db..6d95af3e 100644 --- a/test/benchmark/string_equals.wren +++ b/test/benchmark/string_equals.wren @@ -1,4 +1,4 @@ -var start = IO.clock +var start = System.clock var count = 0 for (i in 1..1000000) { @@ -20,5 +20,5 @@ for (i in 1..1000000) { "another") count = count + 1 } -IO.print(count) -IO.print("elapsed: ", IO.clock - start) +System.print(count) +System.print("elapsed: " + (System.clock - start).toString) diff --git a/test/core/bool/equality.wren b/test/core/bool/equality.wren index 6797482a..1a88261f 100644 --- a/test/core/bool/equality.wren +++ b/test/core/bool/equality.wren @@ -1,23 +1,23 @@ -IO.print(true == true) // expect: true -IO.print(true == false) // expect: false -IO.print(false == true) // expect: false -IO.print(false == false) // expect: true +System.print(true == true) // expect: true +System.print(true == false) // expect: false +System.print(false == true) // expect: false +System.print(false == false) // expect: true // Not equal to other types. -IO.print(true == 1) // expect: false -IO.print(false == 0) // expect: false -IO.print(true == "true") // expect: false -IO.print(false == "false") // expect: false -IO.print(false == "") // expect: false +System.print(true == 1) // expect: false +System.print(false == 0) // expect: false +System.print(true == "true") // expect: false +System.print(false == "false") // expect: false +System.print(false == "") // expect: false -IO.print(true != true) // expect: false -IO.print(true != false) // expect: true -IO.print(false != true) // expect: true -IO.print(false != false) // expect: false +System.print(true != true) // expect: false +System.print(true != false) // expect: true +System.print(false != true) // expect: true +System.print(false != false) // expect: false // Not equal to other types. -IO.print(true != 1) // expect: true -IO.print(false != 0) // expect: true -IO.print(true != "true") // expect: true -IO.print(false != "false") // expect: true -IO.print(false != "") // expect: true +System.print(true != 1) // expect: true +System.print(false != 0) // expect: true +System.print(true != "true") // expect: true +System.print(false != "false") // expect: true +System.print(false != "") // expect: true diff --git a/test/core/bool/not.wren b/test/core/bool/not.wren index cc8b7558..e5d57e34 100644 --- a/test/core/bool/not.wren +++ b/test/core/bool/not.wren @@ -1,3 +1,3 @@ -IO.print(!true) // expect: false -IO.print(!false) // expect: true -IO.print(!!true) // expect: true +System.print(!true) // expect: false +System.print(!false) // expect: true +System.print(!!true) // expect: true diff --git a/test/core/bool/to_string.wren b/test/core/bool/to_string.wren index e23c13c6..85eeb45a 100644 --- a/test/core/bool/to_string.wren +++ b/test/core/bool/to_string.wren @@ -1,2 +1,2 @@ -IO.print(true.toString) // expect: true -IO.print(false.toString) // expect: false +System.print(true.toString) // expect: true +System.print(false.toString) // expect: false diff --git a/test/core/bool/type.wren b/test/core/bool/type.wren index 242b7871..b7c7d38c 100644 --- a/test/core/bool/type.wren +++ b/test/core/bool/type.wren @@ -1,4 +1,4 @@ -IO.print(true is Bool) // expect: true -IO.print(true is Object) // expect: true -IO.print(true is Num) // expect: false -IO.print(true.type == Bool) // expect: true +System.print(true is Bool) // expect: true +System.print(true is Object) // expect: true +System.print(true is Num) // expect: false +System.print(true.type == Bool) // expect: true diff --git a/test/core/class/equality.wren b/test/core/class/equality.wren index 51dce1a7..82b36afc 100644 --- a/test/core/class/equality.wren +++ b/test/core/class/equality.wren @@ -1,13 +1,13 @@ -IO.print(Num == Num) // expect: true -IO.print(Num == Bool) // expect: false +System.print(Num == Num) // expect: true +System.print(Num == Bool) // expect: false // Not equal to other types. -IO.print(Num == 123) // expect: false -IO.print(Num == true) // expect: false +System.print(Num == 123) // expect: false +System.print(Num == true) // expect: false -IO.print(Num != Num) // expect: false -IO.print(Num != Bool) // expect: true +System.print(Num != Num) // expect: false +System.print(Num != Bool) // expect: true // Not equal to other types. -IO.print(Num != 123) // expect: true -IO.print(Num != true) // expect: true +System.print(Num != 123) // expect: true +System.print(Num != true) // expect: true diff --git a/test/core/class/name.wren b/test/core/class/name.wren index f2b561a8..2f36c2e1 100644 --- a/test/core/class/name.wren +++ b/test/core/class/name.wren @@ -1,13 +1,13 @@ class Foo {} -IO.print(Foo.name) // expect: Foo -IO.print(Foo.type.name) // expect: Foo metaclass +System.print(Foo.name) // expect: Foo +System.print(Foo.type.name) // expect: Foo metaclass // Make sure the built-in classes have proper names too. -IO.print(Object.name) // expect: Object -IO.print(Bool.name) // expect: Bool -IO.print(Class.name) // expect: Class +System.print(Object.name) // expect: Object +System.print(Bool.name) // expect: Bool +System.print(Class.name) // expect: Class // And metaclass names. -IO.print(Object.type.name) // expect: Object metaclass -IO.print(Bool.type.name) // expect: Bool metaclass +System.print(Object.type.name) // expect: Object metaclass +System.print(Bool.type.name) // expect: Bool metaclass diff --git a/test/core/class/supertype.wren b/test/core/class/supertype.wren index 9705c188..c24549b2 100644 --- a/test/core/class/supertype.wren +++ b/test/core/class/supertype.wren @@ -5,11 +5,11 @@ class Bar is Foo {} class Baz is Bar {} // A class with no explicit superclass inherits Object. -IO.print(Foo.supertype == Object) // expect: true +System.print(Foo.supertype == Object) // expect: true // Otherwise, it's the superclass. -IO.print(Bar.supertype == Foo) // expect: true -IO.print(Baz.supertype == Bar) // expect: true +System.print(Bar.supertype == Foo) // expect: true +System.print(Baz.supertype == Bar) // expect: true // Object has no supertype. -IO.print(Object.supertype) // expect: null +System.print(Object.supertype) // expect: null diff --git a/test/core/class/type.wren b/test/core/class/type.wren index 5ec7dd38..0c2266a0 100644 --- a/test/core/class/type.wren +++ b/test/core/class/type.wren @@ -1,15 +1,15 @@ class Foo {} // A class is a class. -IO.print(Foo is Class) // expect: true +System.print(Foo is Class) // expect: true // Its metatype is also a class. -IO.print(Foo.type is Class) // expect: true +System.print(Foo.type is Class) // expect: true // The metatype's metatype is Class. -IO.print(Foo.type.type == Class) // expect: true +System.print(Foo.type.type == Class) // expect: true // And Class's metatype circles back onto itself. -IO.print(Foo.type.type.type == Class) // expect: true -IO.print(Foo.type.type.type.type == Class) // expect: true -IO.print(Foo.type.type.type.type.type == Class) // expect: true +System.print(Foo.type.type.type == Class) // expect: true +System.print(Foo.type.type.type.type == Class) // expect: true +System.print(Foo.type.type.type.type.type == Class) // expect: true diff --git a/test/core/fiber/abort.wren b/test/core/fiber/abort.wren index 2823ede3..1f63d325 100644 --- a/test/core/fiber/abort.wren +++ b/test/core/fiber/abort.wren @@ -2,6 +2,6 @@ var fiber = Fiber.new { Fiber.abort("Error message.") } -IO.print(fiber.try()) // expect: Error message. -IO.print(fiber.isDone) // expect: true -IO.print(fiber.error) // expect: Error message. +System.print(fiber.try()) // expect: Error message. +System.print(fiber.isDone) // expect: true +System.print(fiber.error) // expect: Error message. diff --git a/test/core/fiber/call.wren b/test/core/fiber/call.wren index 7ad0b832..6339f273 100644 --- a/test/core/fiber/call.wren +++ b/test/core/fiber/call.wren @@ -1,7 +1,7 @@ var fiber = Fiber.new { - IO.print("fiber") + System.print("fiber") } -IO.print("before") // expect: before +System.print("before") // expect: before fiber.call() // expect: fiber -IO.print("after") // expect: after +System.print("after") // expect: after diff --git a/test/core/fiber/call_done.wren b/test/core/fiber/call_done.wren index 894a803f..9839bd08 100644 --- a/test/core/fiber/call_done.wren +++ b/test/core/fiber/call_done.wren @@ -1,5 +1,5 @@ var fiber = Fiber.new { - IO.print("call") + System.print("call") } fiber.call() // expect: call diff --git a/test/core/fiber/call_error.wren b/test/core/fiber/call_error.wren index 57742ec9..5f05436a 100644 --- a/test/core/fiber/call_error.wren +++ b/test/core/fiber/call_error.wren @@ -1,6 +1,6 @@ var fiber = Fiber.new { Fiber.abort("Error!") - IO.print("should not get here") + System.print("should not get here") } fiber.try() diff --git a/test/core/fiber/call_return_implicit_null.wren b/test/core/fiber/call_return_implicit_null.wren index 0ce9a9a0..9464ba13 100644 --- a/test/core/fiber/call_return_implicit_null.wren +++ b/test/core/fiber/call_return_implicit_null.wren @@ -1,5 +1,5 @@ var fiber = Fiber.new { - IO.print("fiber") // expect: fiber + System.print("fiber") // expect: fiber } -IO.print(fiber.call()) // expect: null +System.print(fiber.call()) // expect: null diff --git a/test/core/fiber/call_return_value.wren b/test/core/fiber/call_return_value.wren index c4dd58d9..6e0b70ef 100644 --- a/test/core/fiber/call_return_value.wren +++ b/test/core/fiber/call_return_value.wren @@ -1,6 +1,6 @@ var fiber = Fiber.new { - IO.print("fiber") + System.print("fiber") return "result" // expect: fiber } -IO.print(fiber.call()) // expect: result +System.print(fiber.call()) // expect: result diff --git a/test/core/fiber/call_transferred.wren b/test/core/fiber/call_transferred.wren index b174ae54..11c5248b 100644 --- a/test/core/fiber/call_transferred.wren +++ b/test/core/fiber/call_transferred.wren @@ -1,12 +1,12 @@ var main = Fiber.current var fiber = Fiber.new { - IO.print("transferred") - IO.print(main.transfer()) - IO.print("called") + System.print("transferred") + System.print(main.transfer()) + System.print("called") } fiber.transfer() // expect: transferred -IO.print("main") // expect: main +System.print("main") // expect: main fiber.call() // expect: null // expect: called diff --git a/test/core/fiber/call_with_value.wren b/test/core/fiber/call_with_value.wren index 10c905f8..2008bed2 100644 --- a/test/core/fiber/call_with_value.wren +++ b/test/core/fiber/call_with_value.wren @@ -1,9 +1,9 @@ var fiber = Fiber.new { - IO.print("fiber") + System.print("fiber") } // The first value passed to the fiber is ignored, since there's no yield call // to return it. -IO.print("before") // expect: before +System.print("before") // expect: before fiber.call("ignored") // expect: fiber -IO.print("after") // expect: after +System.print("after") // expect: after diff --git a/test/core/fiber/call_with_value_done.wren b/test/core/fiber/call_with_value_done.wren index 491a7f6e..715e235e 100644 --- a/test/core/fiber/call_with_value_done.wren +++ b/test/core/fiber/call_with_value_done.wren @@ -1,5 +1,5 @@ var fiber = Fiber.new { - IO.print("call") + System.print("call") } fiber.call(1) // expect: call diff --git a/test/core/fiber/call_with_value_error.wren b/test/core/fiber/call_with_value_error.wren index e5513755..e4280cb0 100644 --- a/test/core/fiber/call_with_value_error.wren +++ b/test/core/fiber/call_with_value_error.wren @@ -1,6 +1,6 @@ var fiber = Fiber.new { Fiber.abort("Error!") - IO.print("should not get here") + System.print("should not get here") } fiber.try() diff --git a/test/core/fiber/call_with_value_transferred.wren b/test/core/fiber/call_with_value_transferred.wren index b0e1cc99..aa52b2f4 100644 --- a/test/core/fiber/call_with_value_transferred.wren +++ b/test/core/fiber/call_with_value_transferred.wren @@ -1,12 +1,12 @@ var main = Fiber.current var fiber = Fiber.new { - IO.print("transferred") - IO.print(main.transfer()) - IO.print("called") + System.print("transferred") + System.print(main.transfer()) + System.print("called") } fiber.transfer() // expect: transferred -IO.print("main") // expect: main +System.print("main") // expect: main fiber.call("value") // expect: value // expect: called diff --git a/test/core/fiber/error.wren b/test/core/fiber/error.wren index f6087d98..3ec0374b 100644 --- a/test/core/fiber/error.wren +++ b/test/core/fiber/error.wren @@ -2,6 +2,6 @@ var fiber = Fiber.new { "s".unknown } -IO.print(fiber.error) // expect: null -IO.print(fiber.try()) // expect: String does not implement 'unknown'. -IO.print(fiber.error) // expect: String does not implement 'unknown'. +System.print(fiber.error) // expect: null +System.print(fiber.try()) // expect: String does not implement 'unknown'. +System.print(fiber.error) // expect: String does not implement 'unknown'. diff --git a/test/core/fiber/is_done.wren b/test/core/fiber/is_done.wren index f4d500b8..941d5a63 100644 --- a/test/core/fiber/is_done.wren +++ b/test/core/fiber/is_done.wren @@ -1,11 +1,11 @@ var fiber = Fiber.new { - IO.print("1") + System.print("1") Fiber.yield() - IO.print("2") + System.print("2") } -IO.print(fiber.isDone) // expect: false +System.print(fiber.isDone) // expect: false fiber.call() // expect: 1 -IO.print(fiber.isDone) // expect: false +System.print(fiber.isDone) // expect: false fiber.call() // expect: 2 -IO.print(fiber.isDone) // expect: true +System.print(fiber.isDone) // expect: true diff --git a/test/core/fiber/is_done_after_error.wren b/test/core/fiber/is_done_after_error.wren index 479b8d3c..4fd33093 100644 --- a/test/core/fiber/is_done_after_error.wren +++ b/test/core/fiber/is_done_after_error.wren @@ -3,4 +3,4 @@ var fiber = Fiber.new { } fiber.try() -IO.print(fiber.isDone) // expect: true +System.print(fiber.isDone) // expect: true diff --git a/test/core/fiber/resume_caller.wren b/test/core/fiber/resume_caller.wren index 64a726db..31c34072 100644 --- a/test/core/fiber/resume_caller.wren +++ b/test/core/fiber/resume_caller.wren @@ -1,16 +1,16 @@ var b = Fiber.new { - IO.print("fiber b") + System.print("fiber b") } var a = Fiber.new { - IO.print("begin fiber a") + System.print("begin fiber a") b.call() - IO.print("end fiber a") + System.print("end fiber a") } -IO.print("begin main") +System.print("begin main") a.call() -IO.print("end main") +System.print("end main") // expect: begin main // expect: begin fiber a diff --git a/test/core/fiber/transfer.wren b/test/core/fiber/transfer.wren index b97fe109..b4284f8c 100644 --- a/test/core/fiber/transfer.wren +++ b/test/core/fiber/transfer.wren @@ -1,20 +1,20 @@ var a = Fiber.new { - IO.print("a") + System.print("a") } var b = Fiber.new { - IO.print("b before") + System.print("b before") a.transfer() - IO.print("b after") + System.print("b after") } var c = Fiber.new { - IO.print("c before") + System.print("c before") b.transfer() - IO.print("c after") + System.print("c after") } -IO.print("start") // expect: start +System.print("start") // expect: start c.transfer() // expect: c before diff --git a/test/core/fiber/transfer_direct_reenter.wren b/test/core/fiber/transfer_direct_reenter.wren index ce424e0d..66559330 100644 --- a/test/core/fiber/transfer_direct_reenter.wren +++ b/test/core/fiber/transfer_direct_reenter.wren @@ -1,9 +1,9 @@ var F = Fiber.new { - IO.print(1) // expect: 1 - IO.print(F.transfer()) // expect: null - IO.print(2) // expect: 2 + System.print(1) // expect: 1 + System.print(F.transfer()) // expect: null + System.print(2) // expect: 2 } F.call() // F remembers its original caller so transfers back to main. -IO.print(3) // expect: 3 +System.print(3) // expect: 3 diff --git a/test/core/fiber/transfer_indirect_reenter.wren b/test/core/fiber/transfer_indirect_reenter.wren index 2a2cfaff..763867ef 100644 --- a/test/core/fiber/transfer_indirect_reenter.wren +++ b/test/core/fiber/transfer_indirect_reenter.wren @@ -1,13 +1,13 @@ var A = Fiber.new { - IO.print(2) + System.print(2) B.transfer() - IO.print("nope") + System.print("nope") } var B = Fiber.new { - IO.print(1) + System.print(1) A.transfer() - IO.print(3) + System.print(3) } B.call() @@ -15,4 +15,4 @@ B.call() // expect: 2 // expect: 3 // B remembers its original caller so returns to main. -IO.print(4) // expect: 4 +System.print(4) // expect: 4 diff --git a/test/core/fiber/transfer_return_call_value.wren b/test/core/fiber/transfer_return_call_value.wren index b12b9261..838597e6 100644 --- a/test/core/fiber/transfer_return_call_value.wren +++ b/test/core/fiber/transfer_return_call_value.wren @@ -1,23 +1,23 @@ var main = Fiber.current var fiber = Fiber.new { - IO.print("fiber 1") - IO.print(main.transfer()) + System.print("fiber 1") + System.print(main.transfer()) // Yield to bounce back to main and clear the caller so we don't get a // double call() error below. Fiber.yield() - IO.print(main.transfer()) + System.print(main.transfer()) } fiber.transfer() // expect: fiber 1 -IO.print("main 1") // expect: main 1 +System.print("main 1") // expect: main 1 fiber.call("call 1") // expect: call 1 -IO.print("main 2") // expect: main 2 +System.print("main 2") // expect: main 2 // Transfer back into the fiber so it has a NULL caller. fiber.transfer() fiber.call() // expect: null -IO.print("main 3") // expect: main 3 +System.print("main 3") // expect: main 3 diff --git a/test/core/fiber/transfer_return_transfer_value.wren b/test/core/fiber/transfer_return_transfer_value.wren index 9bde5a0f..a8338692 100644 --- a/test/core/fiber/transfer_return_transfer_value.wren +++ b/test/core/fiber/transfer_return_transfer_value.wren @@ -1,13 +1,13 @@ var main = Fiber.current var fiber = Fiber.new { - IO.print("fiber") - IO.print(main.transfer()) + System.print("fiber") + System.print(main.transfer()) } fiber.transfer() // expect: fiber -IO.print("main") // expect: main +System.print("main") // expect: main fiber.transfer("transfer") // expect: transfer // This does not get run since we exit when the transferred fiber completes. -IO.print("nope") +System.print("nope") diff --git a/test/core/fiber/transfer_to_done.wren b/test/core/fiber/transfer_to_done.wren index 8e330850..f5eb0de7 100644 --- a/test/core/fiber/transfer_to_done.wren +++ b/test/core/fiber/transfer_to_done.wren @@ -1,5 +1,5 @@ var a = Fiber.new { - IO.print("run") + System.print("run") } a.call() // expect: run diff --git a/test/core/fiber/transfer_to_error.wren b/test/core/fiber/transfer_to_error.wren index c50e770b..18dae072 100644 --- a/test/core/fiber/transfer_to_error.wren +++ b/test/core/fiber/transfer_to_error.wren @@ -1,6 +1,6 @@ var a = Fiber.new { Fiber.abort("Error!") - IO.print("should not get here") + System.print("should not get here") } a.try() diff --git a/test/core/fiber/transfer_to_yielded.wren b/test/core/fiber/transfer_to_yielded.wren index f74f1526..a03de88b 100644 --- a/test/core/fiber/transfer_to_yielded.wren +++ b/test/core/fiber/transfer_to_yielded.wren @@ -1,7 +1,7 @@ var fiber = Fiber.new { - IO.print("called") - IO.print(Fiber.yield()) - IO.print("transferred") + System.print("called") + System.print(Fiber.yield()) + System.print("transferred") } fiber.call() // expect: called diff --git a/test/core/fiber/transfer_with_value.wren b/test/core/fiber/transfer_with_value.wren index efe8f956..9d60a707 100644 --- a/test/core/fiber/transfer_with_value.wren +++ b/test/core/fiber/transfer_with_value.wren @@ -1,20 +1,20 @@ var a = Fiber.new { - IO.print("a") + System.print("a") } var b = Fiber.new { - IO.print("b before") + System.print("b before") a.transfer("ignored") - IO.print("b after") + System.print("b after") } var c = Fiber.new { - IO.print("c before") + System.print("c before") b.transfer("ignored") - IO.print("c after") + System.print("c after") } -IO.print("start") // expect: start +System.print("start") // expect: start c.transfer("ignored") // expect: c before diff --git a/test/core/fiber/transfer_with_value_direct_reenter.wren b/test/core/fiber/transfer_with_value_direct_reenter.wren index b5b92b1f..1fb7ae18 100644 --- a/test/core/fiber/transfer_with_value_direct_reenter.wren +++ b/test/core/fiber/transfer_with_value_direct_reenter.wren @@ -1,8 +1,8 @@ var F = Fiber.new { - IO.print(1) // expect: 1 - IO.print(F.transfer("value")) // expect: value - IO.print(2) // expect: 2 + System.print(1) // expect: 1 + System.print(F.transfer("value")) // expect: value + System.print(2) // expect: 2 } F.call() -IO.print(3) // expect: 3 +System.print(3) // expect: 3 diff --git a/test/core/fiber/transfer_with_value_indirect_reenter.wren b/test/core/fiber/transfer_with_value_indirect_reenter.wren index d98092c6..2423a152 100644 --- a/test/core/fiber/transfer_with_value_indirect_reenter.wren +++ b/test/core/fiber/transfer_with_value_indirect_reenter.wren @@ -1,17 +1,17 @@ var A = Fiber.new { - IO.print(2) + System.print(2) B.transfer("ignored") - IO.print("nope") + System.print("nope") } var B = Fiber.new { - IO.print(1) + System.print(1) A.transfer("ignored") - IO.print(3) + System.print(3) } B.call() // expect: 1 // expect: 2 // expect: 3 -IO.print(4) // expect: 4 +System.print(4) // expect: 4 diff --git a/test/core/fiber/transfer_with_value_to_done.wren b/test/core/fiber/transfer_with_value_to_done.wren index 980b6e11..c156ce7e 100644 --- a/test/core/fiber/transfer_with_value_to_done.wren +++ b/test/core/fiber/transfer_with_value_to_done.wren @@ -1,5 +1,5 @@ var a = Fiber.new { - IO.print("run") + System.print("run") } a.call() // expect: run diff --git a/test/core/fiber/transfer_with_value_to_error.wren b/test/core/fiber/transfer_with_value_to_error.wren index f8ec2f97..3a458503 100644 --- a/test/core/fiber/transfer_with_value_to_error.wren +++ b/test/core/fiber/transfer_with_value_to_error.wren @@ -1,6 +1,6 @@ var a = Fiber.new { Fiber.abort("Error!") - IO.print("should not get here") + System.print("should not get here") } a.try() diff --git a/test/core/fiber/transfer_with_value_to_yielded.wren b/test/core/fiber/transfer_with_value_to_yielded.wren index 016dc790..4bf807f7 100644 --- a/test/core/fiber/transfer_with_value_to_yielded.wren +++ b/test/core/fiber/transfer_with_value_to_yielded.wren @@ -1,7 +1,7 @@ var fiber = Fiber.new { - IO.print("called") - IO.print(Fiber.yield()) - IO.print("transferred") + System.print("called") + System.print(Fiber.yield()) + System.print("transferred") } fiber.call() // expect: called diff --git a/test/core/fiber/try.wren b/test/core/fiber/try.wren index dbb5582e..51d065fd 100644 --- a/test/core/fiber/try.wren +++ b/test/core/fiber/try.wren @@ -1,10 +1,10 @@ var fiber = Fiber.new { - IO.print("before") + System.print("before") true.unknownMethod - IO.print("after") + System.print("after") } -IO.print(fiber.try()) +System.print(fiber.try()) // expect: before // expect: Bool does not implement 'unknownMethod'. -IO.print("after try") // expect: after try +System.print("after try") // expect: after try diff --git a/test/core/fiber/try_when_done.wren b/test/core/fiber/try_when_done.wren index 180d9d95..40d4d928 100644 --- a/test/core/fiber/try_when_done.wren +++ b/test/core/fiber/try_when_done.wren @@ -1,5 +1,5 @@ var fiber = Fiber.new { - IO.print("try") + System.print("try") } fiber.try() // expect: try diff --git a/test/core/fiber/try_without_error.wren b/test/core/fiber/try_without_error.wren index c9314303..c84a13dc 100644 --- a/test/core/fiber/try_without_error.wren +++ b/test/core/fiber/try_without_error.wren @@ -1,8 +1,8 @@ var fiber = Fiber.new { - IO.print("fiber") + System.print("fiber") } -IO.print("before") // expect: before -IO.print(fiber.try()) // expect: fiber +System.print("before") // expect: before +System.print(fiber.try()) // expect: fiber // expect: null -IO.print("after") // expect: after +System.print("after") // expect: after diff --git a/test/core/fiber/type.wren b/test/core/fiber/type.wren index 49da2437..39c946ce 100644 --- a/test/core/fiber/type.wren +++ b/test/core/fiber/type.wren @@ -1,5 +1,5 @@ var fiber = Fiber.new {} -IO.print(fiber is Fiber) // expect: true -IO.print(fiber is Object) // expect: true -IO.print(fiber is Bool) // expect: false -IO.print(fiber.type == Fiber) // expect: true +System.print(fiber is Fiber) // expect: true +System.print(fiber is Object) // expect: true +System.print(fiber is Bool) // expect: false +System.print(fiber.type == Fiber) // expect: true diff --git a/test/core/fiber/yield.wren b/test/core/fiber/yield.wren index ea4491c1..868a74e2 100644 --- a/test/core/fiber/yield.wren +++ b/test/core/fiber/yield.wren @@ -1,14 +1,14 @@ var fiber = Fiber.new { - IO.print("fiber 1") + System.print("fiber 1") Fiber.yield() - IO.print("fiber 2") + System.print("fiber 2") Fiber.yield() - IO.print("fiber 3") + System.print("fiber 3") } fiber.call() // expect: fiber 1 -IO.print("main 1") // expect: main 1 +System.print("main 1") // expect: main 1 fiber.call() // expect: fiber 2 -IO.print("main 2") // expect: main 2 +System.print("main 2") // expect: main 2 fiber.call() // expect: fiber 3 -IO.print("main 3") // expect: main 3 +System.print("main 3") // expect: main 3 diff --git a/test/core/fiber/yield_from_main.wren b/test/core/fiber/yield_from_main.wren index bea7be34..3bc7e5aa 100644 --- a/test/core/fiber/yield_from_main.wren +++ b/test/core/fiber/yield_from_main.wren @@ -1,3 +1,3 @@ -IO.print("before") // expect: before +System.print("before") // expect: before Fiber.yield() -IO.print("not reached") +System.print("not reached") diff --git a/test/core/fiber/yield_return_call_value.wren b/test/core/fiber/yield_return_call_value.wren index b858fd26..d464ec20 100644 --- a/test/core/fiber/yield_return_call_value.wren +++ b/test/core/fiber/yield_return_call_value.wren @@ -1,12 +1,12 @@ var fiber = Fiber.new { - IO.print("fiber 1") - IO.print(Fiber.yield()) - IO.print(Fiber.yield()) + System.print("fiber 1") + System.print(Fiber.yield()) + System.print(Fiber.yield()) } fiber.call() // expect: fiber 1 -IO.print("main 1") // expect: main 1 +System.print("main 1") // expect: main 1 fiber.call("call 1") // expect: call 1 -IO.print("main 2") // expect: main 2 +System.print("main 2") // expect: main 2 fiber.call() // expect: null -IO.print("main 3") // expect: main 3 +System.print("main 3") // expect: main 3 diff --git a/test/core/fiber/yield_return_transfer_value.wren b/test/core/fiber/yield_return_transfer_value.wren index a345ea7c..c8b85642 100644 --- a/test/core/fiber/yield_return_transfer_value.wren +++ b/test/core/fiber/yield_return_transfer_value.wren @@ -1,13 +1,13 @@ var main = Fiber.current var a = Fiber.new { - IO.print("a") - IO.print(Fiber.yield()) + System.print("a") + System.print(Fiber.yield()) } var b = Fiber.new { - IO.print("b") - IO.print(Fiber.yield()) + System.print("b") + System.print(Fiber.yield()) a.call() a.transfer("value") diff --git a/test/core/fiber/yield_with_no_caller.wren b/test/core/fiber/yield_with_no_caller.wren index 49b975c2..aa1a4aa6 100644 --- a/test/core/fiber/yield_with_no_caller.wren +++ b/test/core/fiber/yield_with_no_caller.wren @@ -1,7 +1,7 @@ var a = Fiber.new { - IO.print("before") // expect: before + System.print("before") // expect: before Fiber.yield() - IO.print("not reached") + System.print("not reached") } // Transfer through a chain of fibers. Since none of them are called, they all @@ -9,4 +9,4 @@ var a = Fiber.new { var b = Fiber.new { a.transfer() } var c = Fiber.new { b.transfer() } c.transfer() -IO.print("not reached") \ No newline at end of file +System.print("not reached") \ No newline at end of file diff --git a/test/core/fiber/yield_with_value.wren b/test/core/fiber/yield_with_value.wren index 979c3c81..8995ef54 100644 --- a/test/core/fiber/yield_with_value.wren +++ b/test/core/fiber/yield_with_value.wren @@ -1,14 +1,14 @@ var fiber = Fiber.new { - IO.print("fiber 1") + System.print("fiber 1") Fiber.yield("yield 1") - IO.print("fiber 2") + System.print("fiber 2") Fiber.yield("yield 2") - IO.print("fiber 3") + System.print("fiber 3") } -IO.print(fiber.call()) // expect: fiber 1 +System.print(fiber.call()) // expect: fiber 1 // expect: yield 1 -IO.print(fiber.call()) // expect: fiber 2 +System.print(fiber.call()) // expect: fiber 2 // expect: yield 2 -IO.print(fiber.call()) // expect: fiber 3 +System.print(fiber.call()) // expect: fiber 3 // expect: null diff --git a/test/core/fiber/yield_with_value_from_main.wren b/test/core/fiber/yield_with_value_from_main.wren index f535a7b8..3306e537 100644 --- a/test/core/fiber/yield_with_value_from_main.wren +++ b/test/core/fiber/yield_with_value_from_main.wren @@ -1,3 +1,3 @@ -IO.print("before") // expect: before +System.print("before") // expect: before Fiber.yield(1) -IO.print("not reached") \ No newline at end of file +System.print("not reached") \ No newline at end of file diff --git a/test/core/fiber/yield_with_value_with_no_caller.wren b/test/core/fiber/yield_with_value_with_no_caller.wren index 615e96cd..388749a7 100644 --- a/test/core/fiber/yield_with_value_with_no_caller.wren +++ b/test/core/fiber/yield_with_value_with_no_caller.wren @@ -1,7 +1,7 @@ var a = Fiber.new { - IO.print("before") // expect: before + System.print("before") // expect: before Fiber.yield(1) - IO.print("not reached") + System.print("not reached") } // Transfer through a chain of fibers. Since none of them are called, they all @@ -9,4 +9,4 @@ var a = Fiber.new { var b = Fiber.new { a.transfer() } var c = Fiber.new { b.transfer() } c.transfer() -IO.print("not reached") +System.print("not reached") diff --git a/test/core/function/arity.wren b/test/core/function/arity.wren index ab40eff9..3329cc99 100644 --- a/test/core/function/arity.wren +++ b/test/core/function/arity.wren @@ -1,5 +1,5 @@ -IO.print(Fn.new {}.arity) // expect: 0 -IO.print(Fn.new {|a| a}.arity) // expect: 1 -IO.print(Fn.new {|a, b| a}.arity) // expect: 2 -IO.print(Fn.new {|a, b, c| a}.arity) // expect: 3 -IO.print(Fn.new {|a, b, c, d| a}.arity) // expect: 4 +System.print(Fn.new {}.arity) // expect: 0 +System.print(Fn.new {|a| a}.arity) // expect: 1 +System.print(Fn.new {|a, b| a}.arity) // expect: 2 +System.print(Fn.new {|a, b, c| a}.arity) // expect: 3 +System.print(Fn.new {|a, b, c, d| a}.arity) // expect: 4 diff --git a/test/core/function/call_extra_arguments.wren b/test/core/function/call_extra_arguments.wren index f183576f..2a0c22bd 100644 --- a/test/core/function/call_extra_arguments.wren +++ b/test/core/function/call_extra_arguments.wren @@ -1,7 +1,7 @@ -var f0 = Fn.new { IO.print("zero") } -var f1 = Fn.new {|a| IO.print("one ", a) } -var f2 = Fn.new {|a, b| IO.print("two ", a, " ", b) } -var f3 = Fn.new {|a, b, c| IO.print("three ", a, " ", b, " ", c) } +var f0 = Fn.new { System.print("zero") } +var f1 = Fn.new {|a| System.print("one " + a) } +var f2 = Fn.new {|a, b| System.print("two " + a + " " + b) } +var f3 = Fn.new {|a, b, c| System.print("three " + a + " " + b + " " + c) } f0.call("a") // expect: zero f0.call("a", "b") // expect: zero diff --git a/test/core/function/call_missing_arguments.wren b/test/core/function/call_missing_arguments.wren index 162623c9..3f7b47b4 100644 --- a/test/core/function/call_missing_arguments.wren +++ b/test/core/function/call_missing_arguments.wren @@ -1,2 +1,2 @@ -var f2 = Fn.new {|a, b| IO.print(a, b) } +var f2 = Fn.new {|a, b| System.print(a, b) } f2.call("a") // expect runtime error: Function expects more arguments. diff --git a/test/core/function/equality.wren b/test/core/function/equality.wren index 29239518..2164915b 100644 --- a/test/core/function/equality.wren +++ b/test/core/function/equality.wren @@ -1,16 +1,16 @@ // Not structurally equal. -IO.print(Fn.new { 123 } == Fn.new { 123 }) // expect: false -IO.print(Fn.new { 123 } != Fn.new { 123 }) // expect: true +System.print(Fn.new { 123 } == Fn.new { 123 }) // expect: false +System.print(Fn.new { 123 } != Fn.new { 123 }) // expect: true // Not equal to other types. -IO.print(Fn.new { 123 } == 1) // expect: false -IO.print(Fn.new { 123 } == false) // expect: false -IO.print(Fn.new { 123 } == "fn 123") // expect: false -IO.print(Fn.new { 123 } != 1) // expect: true -IO.print(Fn.new { 123 } != false) // expect: true -IO.print(Fn.new { 123 } != "fn 123") // expect: true +System.print(Fn.new { 123 } == 1) // expect: false +System.print(Fn.new { 123 } == false) // expect: false +System.print(Fn.new { 123 } == "fn 123") // expect: false +System.print(Fn.new { 123 } != 1) // expect: true +System.print(Fn.new { 123 } != false) // expect: true +System.print(Fn.new { 123 } != "fn 123") // expect: true // Equal by identity. var f = Fn.new { 123 } -IO.print(f == f) // expect: true -IO.print(f != f) // expect: false +System.print(f == f) // expect: true +System.print(f != f) // expect: false diff --git a/test/core/function/to_string.wren b/test/core/function/to_string.wren index 8a72cbe3..e78807ea 100644 --- a/test/core/function/to_string.wren +++ b/test/core/function/to_string.wren @@ -1 +1 @@ -IO.print(Fn.new {}) // expect: +System.print(Fn.new {}) // expect: diff --git a/test/core/function/type.wren b/test/core/function/type.wren index 429d9e37..9cd00a16 100644 --- a/test/core/function/type.wren +++ b/test/core/function/type.wren @@ -1,4 +1,4 @@ -IO.print(Fn.new { 0 } is Fn) // expect: true -IO.print(Fn.new { 0 } is Object) // expect: true -IO.print(Fn.new { 0 } is String) // expect: false -IO.print(Fn.new { 0 }.type == Fn) // expect: true +System.print(Fn.new { 0 } is Fn) // expect: true +System.print(Fn.new { 0 } is Object) // expect: true +System.print(Fn.new { 0 } is String) // expect: false +System.print(Fn.new { 0 }.type == Fn) // expect: true diff --git a/test/core/list/add.wren b/test/core/list/add.wren index 33025499..3a2c0b86 100644 --- a/test/core/list/add.wren +++ b/test/core/list/add.wren @@ -1,8 +1,8 @@ var a = [1] a.add(2) -IO.print(a) // expect: [1, 2] +System.print(a) // expect: [1, 2] a.add(3) -IO.print(a) // expect: [1, 2, 3] +System.print(a) // expect: [1, 2, 3] // Returns added element. -IO.print(a.add(4)) // expect: 4 +System.print(a.add(4)) // expect: 4 diff --git a/test/core/list/add_all.wren b/test/core/list/add_all.wren index 1d79b852..bdfae735 100644 --- a/test/core/list/add_all.wren +++ b/test/core/list/add_all.wren @@ -1,11 +1,11 @@ var a = [1] a.addAll([2, 3]) -IO.print(a) // expect: [1, 2, 3] +System.print(a) // expect: [1, 2, 3] a.addAll([]) -IO.print(a) // expect: [1, 2, 3] +System.print(a) // expect: [1, 2, 3] a.addAll(4..6) -IO.print(a) // expect: [1, 2, 3, 4, 5, 6] +System.print(a) // expect: [1, 2, 3, 4, 5, 6] // Returns argument. var range = 7..9 -IO.print(a.addAll(range) == range) // expect: true +System.print(a.addAll(range) == range) // expect: true diff --git a/test/core/list/clear.wren b/test/core/list/clear.wren index 6f76a558..a093abe7 100644 --- a/test/core/list/clear.wren +++ b/test/core/list/clear.wren @@ -1,7 +1,7 @@ var a = [1, 2, 3] a.clear() -IO.print(a) // expect: [] -IO.print(a.count) // expect: 0 +System.print(a) // expect: [] +System.print(a.count) // expect: 0 // Returns null. -IO.print([1, 2].clear()) // expect: null +System.print([1, 2].clear()) // expect: null diff --git a/test/core/list/contains.wren b/test/core/list/contains.wren index 8ceae4d0..9e13364b 100644 --- a/test/core/list/contains.wren +++ b/test/core/list/contains.wren @@ -1,6 +1,6 @@ var list = [1, 2, 3, 4, "foo"] -IO.print(list.contains(2)) // expect: true -IO.print(list.contains(5)) // expect: false -IO.print(list.contains("foo")) // expect: true -IO.print(list.contains("bar")) // expect: false +System.print(list.contains(2)) // expect: true +System.print(list.contains(5)) // expect: false +System.print(list.contains("foo")) // expect: true +System.print(list.contains("bar")) // expect: false diff --git a/test/core/list/count.wren b/test/core/list/count.wren index 9b5c2f10..8d40c5bc 100644 --- a/test/core/list/count.wren +++ b/test/core/list/count.wren @@ -1,3 +1,3 @@ -IO.print([].count) // expect: 0 -IO.print([1].count) // expect: 1 -IO.print([1, 2, 3, 4].count) // expect: 4 +System.print([].count) // expect: 0 +System.print([1].count) // expect: 1 +System.print([1, 2, 3, 4].count) // expect: 4 diff --git a/test/core/list/count_predicate.wren b/test/core/list/count_predicate.wren index 349cf976..081383da 100644 --- a/test/core/list/count_predicate.wren +++ b/test/core/list/count_predicate.wren @@ -1,6 +1,6 @@ var a = [1, 2, 3] -IO.print(a.count {|x| x > 3 }) // expect: 0 -IO.print(a.count {|x| x > 1 }) // expect: 2 +System.print(a.count {|x| x > 3 }) // expect: 0 +System.print(a.count {|x| x > 1 }) // expect: 2 -IO.print([].count {|x| true }) // expect: 0 +System.print([].count {|x| true }) // expect: 0 diff --git a/test/core/list/count_predicate_non_bool_returning_fn.wren b/test/core/list/count_predicate_non_bool_returning_fn.wren index 35feb0b6..c6f7a749 100644 --- a/test/core/list/count_predicate_non_bool_returning_fn.wren +++ b/test/core/list/count_predicate_non_bool_returning_fn.wren @@ -1,3 +1,3 @@ var a = [1, 2, 3] -IO.print(a.count {|x| "truthy" }) // expect: 3 +System.print(a.count {|x| "truthy" }) // expect: 3 diff --git a/test/core/list/each.wren b/test/core/list/each.wren index 6629a498..20b7e49e 100644 --- a/test/core/list/each.wren +++ b/test/core/list/each.wren @@ -1,3 +1,3 @@ var words = "" ["One", "Two", "Three"].each {|word| words = words + word } -IO.print(words) // expect: OneTwoThree +System.print(words) // expect: OneTwoThree diff --git a/test/core/list/each_no_items.wren b/test/core/list/each_no_items.wren index cc3754a9..c81f55cb 100644 --- a/test/core/list/each_no_items.wren +++ b/test/core/list/each_no_items.wren @@ -1,3 +1,3 @@ var i = 0 [].each {|item| i = i + 1 } -IO.print(i) // expect: 0 +System.print(i) // expect: 0 diff --git a/test/core/list/insert.wren b/test/core/list/insert.wren index ed471a60..debeb9e0 100644 --- a/test/core/list/insert.wren +++ b/test/core/list/insert.wren @@ -1,41 +1,41 @@ // Add to empty list. var a = [] a.insert(0, 1) -IO.print(a) // expect: [1] +System.print(a) // expect: [1] // Normal indices. var b = [1, 2, 3] b.insert(0, 4) -IO.print(b) // expect: [4, 1, 2, 3] +System.print(b) // expect: [4, 1, 2, 3] var c = [1, 2, 3] c.insert(1, 4) -IO.print(c) // expect: [1, 4, 2, 3] +System.print(c) // expect: [1, 4, 2, 3] var d = [1, 2, 3] d.insert(2, 4) -IO.print(d) // expect: [1, 2, 4, 3] +System.print(d) // expect: [1, 2, 4, 3] var e = [1, 2, 3] e.insert(3, 4) -IO.print(e) // expect: [1, 2, 3, 4] +System.print(e) // expect: [1, 2, 3, 4] // Negative indices. var f = [1, 2, 3] f.insert(-4, 4) -IO.print(f) // expect: [4, 1, 2, 3] +System.print(f) // expect: [4, 1, 2, 3] var g = [1, 2, 3] g.insert(-3, 4) -IO.print(g) // expect: [1, 4, 2, 3] +System.print(g) // expect: [1, 4, 2, 3] var h = [1, 2, 3] h.insert(-2, 4) -IO.print(h) // expect: [1, 2, 4, 3] +System.print(h) // expect: [1, 2, 4, 3] var i = [1, 2, 3] i.insert(-1, 4) -IO.print(i) // expect: [1, 2, 3, 4] +System.print(i) // expect: [1, 2, 3, 4] // Returns.inserted value. -IO.print([1, 2].insert(0, 3)) // expect: 3 +System.print([1, 2].insert(0, 3)) // expect: 3 diff --git a/test/core/list/iterate.wren b/test/core/list/iterate.wren index 14bff801..3f48de49 100644 --- a/test/core/list/iterate.wren +++ b/test/core/list/iterate.wren @@ -1,13 +1,13 @@ var a = ["one", "two", "three", "four"] -IO.print(a.iterate(null)) // expect: 0 -IO.print(a.iterate(0)) // expect: 1 -IO.print(a.iterate(1)) // expect: 2 -IO.print(a.iterate(2)) // expect: 3 -IO.print(a.iterate(3)) // expect: false +System.print(a.iterate(null)) // expect: 0 +System.print(a.iterate(0)) // expect: 1 +System.print(a.iterate(1)) // expect: 2 +System.print(a.iterate(2)) // expect: 3 +System.print(a.iterate(3)) // expect: false // Out of bounds. -IO.print(a.iterate(123)) // expect: false -IO.print(a.iterate(-1)) // expect: false +System.print(a.iterate(123)) // expect: false +System.print(a.iterate(-1)) // expect: false // Nothing to iterate in an empty list. -IO.print([].iterate(null)) // expect: false +System.print([].iterate(null)) // expect: false diff --git a/test/core/list/iterator_value.wren b/test/core/list/iterator_value.wren index 899dbc67..093151d2 100644 --- a/test/core/list/iterator_value.wren +++ b/test/core/list/iterator_value.wren @@ -1,5 +1,5 @@ var a = ["one", "two", "three", "four"] -IO.print(a.iteratorValue(0)) // expect: one -IO.print(a.iteratorValue(1)) // expect: two -IO.print(a.iteratorValue(2)) // expect: three -IO.print(a.iteratorValue(3)) // expect: four +System.print(a.iteratorValue(0)) // expect: one +System.print(a.iteratorValue(1)) // expect: two +System.print(a.iteratorValue(2)) // expect: three +System.print(a.iteratorValue(3)) // expect: four diff --git a/test/core/list/join.wren b/test/core/list/join.wren index 07f41333..b94b4d16 100644 --- a/test/core/list/join.wren +++ b/test/core/list/join.wren @@ -1,17 +1,17 @@ // Handle empty list. -IO.print([].join(",") == "") // expect: true +System.print([].join(",") == "") // expect: true // Handle a simple list with an empty delimeter. -IO.print([1, 2, 3].join("")) // expect: 123 +System.print([1, 2, 3].join("")) // expect: 123 // Handle a simple list with no separator. -IO.print([1, 2, 3].join) // expect: 123 +System.print([1, 2, 3].join) // expect: 123 // Does not quote strings. -IO.print([1, "2", true].join(",")) // expect: 1,2,true +System.print([1, "2", true].join(",")) // expect: 1,2,true // Nested lists. -IO.print([1, [2, [3], 4], 5].join(",")) // expect: 1,[2, [3], 4],5 +System.print([1, [2, [3], 4], 5].join(",")) // expect: 1,[2, [3], 4],5 // Calls toString on elements. class Foo { @@ -19,6 +19,6 @@ class Foo { toString { "Foo.toString" } } -IO.print([1, Foo.new(), 2].join(", ")) // expect: 1, Foo.toString, 2 +System.print([1, Foo.new(), 2].join(", ")) // expect: 1, Foo.toString, 2 // TODO: Handle lists that contain themselves. diff --git a/test/core/list/map.wren b/test/core/list/map.wren index d3eeed60..178b14e9 100644 --- a/test/core/list/map.wren +++ b/test/core/list/map.wren @@ -1,3 +1,3 @@ var a = [1, 2, 3] var b = a.map {|x| x + 1 }.toList -IO.print(b) // expect: [2, 3, 4] +System.print(b) // expect: [2, 3, 4] diff --git a/test/core/list/new.wren b/test/core/list/new.wren index 2e3af0e6..061384ef 100644 --- a/test/core/list/new.wren +++ b/test/core/list/new.wren @@ -1,6 +1,6 @@ var list = List.new() -IO.print(list.count) // expect: 0 -IO.print(list) // expect: [] +System.print(list.count) // expect: 0 +System.print(list) // expect: [] list.add(1) -IO.print(list) // expect: [1] +System.print(list) // expect: [1] diff --git a/test/core/list/not.wren b/test/core/list/not.wren index a6734cc6..bbb0fc57 100644 --- a/test/core/list/not.wren +++ b/test/core/list/not.wren @@ -1,2 +1,2 @@ -IO.print(![1, 2]) // expect: false -IO.print(![]) // expect: false +System.print(![1, 2]) // expect: false +System.print(![]) // expect: false diff --git a/test/core/list/plus.wren b/test/core/list/plus.wren index d0dda410..98cf60ea 100644 --- a/test/core/list/plus.wren +++ b/test/core/list/plus.wren @@ -6,13 +6,13 @@ var e = a + [] var f = [] + a var g = [] + [] -IO.print(a) // expect: [1, 2, 3] -IO.print(b) // expect: [4, 5, 6] -IO.print(c) // expect: [1, 2, 3, 4, 5, 6] -IO.print(d) // expect: [1, 2, 3, 4, 5, 6] -IO.print(e) // expect: [1, 2, 3] -IO.print(f) // expect: [1, 2, 3] -IO.print(g) // expect: [] +System.print(a) // expect: [1, 2, 3] +System.print(b) // expect: [4, 5, 6] +System.print(c) // expect: [1, 2, 3, 4, 5, 6] +System.print(d) // expect: [1, 2, 3, 4, 5, 6] +System.print(e) // expect: [1, 2, 3] +System.print(f) // expect: [1, 2, 3] +System.print(g) // expect: [] // Doesn't modify original list. -IO.print(a) // expect: [1, 2, 3] +System.print(a) // expect: [1, 2, 3] diff --git a/test/core/list/reduce.wren b/test/core/list/reduce.wren index 87fb87ee..f2a92a8f 100644 --- a/test/core/list/reduce.wren +++ b/test/core/list/reduce.wren @@ -3,12 +3,12 @@ var b = ["W", "o", "r", "l", "d"] var max = Fn.new {|a, b| a > b ? a : b } var sum = Fn.new {|a, b| a + b } -IO.print(a.reduce(max)) // expect: 5 -IO.print(a.reduce(10, max)) // expect: 10 +System.print(a.reduce(max)) // expect: 5 +System.print(a.reduce(10, max)) // expect: 10 -IO.print(a.reduce(sum)) // expect: 13 -IO.print(a.reduce(-1, sum)) // expect: 12 +System.print(a.reduce(sum)) // expect: 13 +System.print(a.reduce(-1, sum)) // expect: 12 // sum also concatenates strings -IO.print(b.reduce("Hello ", sum)) // expect: Hello World -IO.print(b.reduce(sum)) // expect: World +System.print(b.reduce("Hello ", sum)) // expect: Hello World +System.print(b.reduce(sum)) // expect: World diff --git a/test/core/list/reduce_single_item.wren b/test/core/list/reduce_single_item.wren index 0f874c99..3ad5506c 100644 --- a/test/core/list/reduce_single_item.wren +++ b/test/core/list/reduce_single_item.wren @@ -1,2 +1,2 @@ -IO.print([1].reduce {|a, b| 42 }) // expect: 1 -IO.print([].reduce(1) {|a, b| 42 }) // expect: 1 +System.print([1].reduce {|a, b| 42 }) // expect: 1 +System.print([].reduce(1) {|a, b| 42 }) // expect: 1 diff --git a/test/core/list/remove_at.wren b/test/core/list/remove_at.wren index 1668b20b..84f6b51b 100644 --- a/test/core/list/remove_at.wren +++ b/test/core/list/remove_at.wren @@ -1,27 +1,27 @@ var a = [1, 2, 3] a.removeAt(0) -IO.print(a) // expect: [2, 3] +System.print(a) // expect: [2, 3] var b = [1, 2, 3] b.removeAt(1) -IO.print(b) // expect: [1, 3] +System.print(b) // expect: [1, 3] var c = [1, 2, 3] c.removeAt(2) -IO.print(c) // expect: [1, 2] +System.print(c) // expect: [1, 2] // Index backwards from end. var d = [1, 2, 3] d.removeAt(-3) -IO.print(d) // expect: [2, 3] +System.print(d) // expect: [2, 3] var e = [1, 2, 3] e.removeAt(-2) -IO.print(e) // expect: [1, 3] +System.print(e) // expect: [1, 3] var f = [1, 2, 3] f.removeAt(-1) -IO.print(f) // expect: [1, 2] +System.print(f) // expect: [1, 2] // Return the removed value. -IO.print([3, 4, 5].removeAt(1)) // expect: 4 +System.print([3, 4, 5].removeAt(1)) // expect: 4 diff --git a/test/core/list/subscript.wren b/test/core/list/subscript.wren index 8b38e3c3..19633013 100644 --- a/test/core/list/subscript.wren +++ b/test/core/list/subscript.wren @@ -1,12 +1,12 @@ // Returns elements. var list = ["a", "b", "c", "d"] -IO.print(list[0]) // expect: a -IO.print(list[1]) // expect: b -IO.print(list[2]) // expect: c -IO.print(list[3]) // expect: d +System.print(list[0]) // expect: a +System.print(list[1]) // expect: b +System.print(list[2]) // expect: c +System.print(list[3]) // expect: d // Allows indexing backwards from the end. -IO.print(list[-4]) // expect: a -IO.print(list[-3]) // expect: b -IO.print(list[-2]) // expect: c -IO.print(list[-1]) // expect: d +System.print(list[-4]) // expect: a +System.print(list[-3]) // expect: b +System.print(list[-2]) // expect: c +System.print(list[-1]) // expect: d diff --git a/test/core/list/subscript_range.wren b/test/core/list/subscript_range.wren index 08a03a44..b22e9387 100644 --- a/test/core/list/subscript_range.wren +++ b/test/core/list/subscript_range.wren @@ -1,35 +1,35 @@ // Returns lists. var list = ["a", "b", "c", "d", "e"] -IO.print(list[0..0]) // expect: [a] -IO.print(list[1...1]) // expect: [] -IO.print(list[1..2]) // expect: [b, c] -IO.print(list[1...2]) // expect: [b] -IO.print(list[2..4]) // expect: [c, d, e] -IO.print(list[2...5]) // expect: [c, d, e] +System.print(list[0..0]) // expect: [a] +System.print(list[1...1]) // expect: [] +System.print(list[1..2]) // expect: [b, c] +System.print(list[1...2]) // expect: [b] +System.print(list[2..4]) // expect: [c, d, e] +System.print(list[2...5]) // expect: [c, d, e] // A backwards range reverses. -IO.print(list[3..1]) // expect: [d, c, b] -IO.print(list[3...1]) // expect: [d, c] -IO.print(list[3...3]) // expect: [] +System.print(list[3..1]) // expect: [d, c, b] +System.print(list[3...1]) // expect: [d, c] +System.print(list[3...3]) // expect: [] // Negative ranges index from the end. -IO.print(list[-5..-2]) // expect: [a, b, c, d] -IO.print(list[-5...-2]) // expect: [a, b, c] -IO.print(list[-3..-5]) // expect: [c, b, a] -IO.print(list[-3...-6]) // expect: [c, b, a] +System.print(list[-5..-2]) // expect: [a, b, c, d] +System.print(list[-5...-2]) // expect: [a, b, c] +System.print(list[-3..-5]) // expect: [c, b, a] +System.print(list[-3...-6]) // expect: [c, b, a] // Half-negative ranges are treated like the negative value is fixed before // walking the range. -IO.print(list[-5..3]) // expect: [a, b, c, d] -IO.print(list[-3...5]) // expect: [c, d, e] -IO.print(list[-2..1]) // expect: [d, c, b] -IO.print(list[-2...0]) // expect: [d, c, b] +System.print(list[-5..3]) // expect: [a, b, c, d] +System.print(list[-3...5]) // expect: [c, d, e] +System.print(list[-2..1]) // expect: [d, c, b] +System.print(list[-2...0]) // expect: [d, c, b] -IO.print(list[1..-2]) // expect: [b, c, d] -IO.print(list[2...-1]) // expect: [c, d] -IO.print(list[4..-5]) // expect: [e, d, c, b, a] -IO.print(list[3...-6]) // expect: [d, c, b, a] +System.print(list[1..-2]) // expect: [b, c, d] +System.print(list[2...-1]) // expect: [c, d] +System.print(list[4..-5]) // expect: [e, d, c, b, a] +System.print(list[3...-6]) // expect: [d, c, b, a] // An empty range at zero is allowed on an empty list. -IO.print([][0...0]) // expect: [] -IO.print([][0..-1]) // expect: [] +System.print([][0...0]) // expect: [] +System.print([][0..-1]) // expect: [] diff --git a/test/core/list/subscript_setter.wren b/test/core/list/subscript_setter.wren index 02d56fb3..2de12da3 100644 --- a/test/core/list/subscript_setter.wren +++ b/test/core/list/subscript_setter.wren @@ -4,13 +4,13 @@ list[0] = 5 list[1] = 6 list[2] = 7 - IO.print(list) // expect: [5, 6, 7] + System.print(list) // expect: [5, 6, 7] } // Returns right-hand side. { var list = [1, 2, 3] - IO.print(list[1] = 5) // expect: 5 + System.print(list[1] = 5) // expect: 5 } // Negative indices. @@ -19,5 +19,5 @@ list[-1] = 5 list[-2] = 6 list[-3] = 7 - IO.print(list) // expect: [7, 6, 5] + System.print(list) // expect: [7, 6, 5] } diff --git a/test/core/list/to_string.wren b/test/core/list/to_string.wren index 8392aa96..d5a23b98 100644 --- a/test/core/list/to_string.wren +++ b/test/core/list/to_string.wren @@ -1,11 +1,11 @@ // Handle empty list. -IO.print([].toString) // expect: [] +System.print([].toString) // expect: [] // Does not quote strings. -IO.print([1, "2", true].toString) // expect: [1, 2, true] +System.print([1, "2", true].toString) // expect: [1, 2, true] // Nested lists. -IO.print([1, [2, [3], 4], 5]) // expect: [1, [2, [3], 4], 5] +System.print([1, [2, [3], 4], 5]) // expect: [1, [2, [3], 4], 5] // Calls toString on elements. class Foo { @@ -13,6 +13,6 @@ class Foo { toString { "Foo.toString" } } -IO.print([1, Foo.new(), 2]) // expect: [1, Foo.toString, 2] +System.print([1, Foo.new(), 2]) // expect: [1, Foo.toString, 2] // TODO: Handle lists that contain themselves. diff --git a/test/core/list/type.wren b/test/core/list/type.wren index 19f706dc..983ac4f8 100644 --- a/test/core/list/type.wren +++ b/test/core/list/type.wren @@ -1,5 +1,5 @@ -IO.print([] is List) // expect: true -IO.print([] is Sequence) // expect: true -IO.print([] is Object) // expect: true -IO.print([] is Bool) // expect: false -IO.print([].type == List) // expect: true +System.print([] is List) // expect: true +System.print([] is Sequence) // expect: true +System.print([] is Object) // expect: true +System.print([] is Bool) // expect: false +System.print([].type == List) // expect: true diff --git a/test/core/list/where.wren b/test/core/list/where.wren index 24383d4f..6a92f39f 100644 --- a/test/core/list/where.wren +++ b/test/core/list/where.wren @@ -1,6 +1,6 @@ var a = [1, 2, 3] var b = a.where {|x| x > 1 }.toList -IO.print(b) // expect: [2, 3] +System.print(b) // expect: [2, 3] var c = a.where {|x| x > 10 }.toList -IO.print(c) // expect: [] +System.print(c) // expect: [] diff --git a/test/core/map/churn.wren b/test/core/map/churn.wren index 97674638..0019011b 100644 --- a/test/core/map/churn.wren +++ b/test/core/map/churn.wren @@ -8,4 +8,4 @@ for (i in 0...100) { if (i >= 10) map.remove(i - 10) } -IO.print(map.count) // expect: 10 +System.print(map.count) // expect: 10 diff --git a/test/core/map/clear.wren b/test/core/map/clear.wren index a580af89..e4b488f5 100644 --- a/test/core/map/clear.wren +++ b/test/core/map/clear.wren @@ -1,7 +1,7 @@ var a = {1: 1, 2: 2, 3: 3} a.clear() -IO.print(a) // expect: {} -IO.print(a.count) // expect: 0 +System.print(a) // expect: {} +System.print(a.count) // expect: 0 // Returns null. -IO.print({1: 2}.clear()) // expect: null +System.print({1: 2}.clear()) // expect: null diff --git a/test/core/map/contains_key.wren b/test/core/map/contains_key.wren index 9dc97c23..298b30bc 100644 --- a/test/core/map/contains_key.wren +++ b/test/core/map/contains_key.wren @@ -4,8 +4,8 @@ var map = { "three": 3 } -IO.print(map.containsKey("one")) // expect: true -IO.print(map.containsKey("two")) // expect: true -IO.print(map.containsKey("three")) // expect: true -IO.print(map.containsKey("four")) // expect: false -IO.print(map.containsKey("five")) // expect: false +System.print(map.containsKey("one")) // expect: true +System.print(map.containsKey("two")) // expect: true +System.print(map.containsKey("three")) // expect: true +System.print(map.containsKey("four")) // expect: false +System.print(map.containsKey("five")) // expect: false diff --git a/test/core/map/count.wren b/test/core/map/count.wren index 028258fe..59fb07a2 100644 --- a/test/core/map/count.wren +++ b/test/core/map/count.wren @@ -1,12 +1,12 @@ var map = {} -IO.print(map.count) // expect: 0 +System.print(map.count) // expect: 0 map["one"] = "value" -IO.print(map.count) // expect: 1 +System.print(map.count) // expect: 1 map["two"] = "value" -IO.print(map.count) // expect: 2 +System.print(map.count) // expect: 2 map["three"] = "value" -IO.print(map.count) // expect: 3 +System.print(map.count) // expect: 3 // Adding existing key does not increase count. map["two"] = "new value" -IO.print(map.count) // expect: 3 +System.print(map.count) // expect: 3 diff --git a/test/core/map/empty_string_key.wren b/test/core/map/empty_string_key.wren index 9af72953..64b9e0f2 100644 --- a/test/core/map/empty_string_key.wren +++ b/test/core/map/empty_string_key.wren @@ -2,4 +2,4 @@ var map = { "": "empty string" } -IO.print(map[""]) // expect: empty string +System.print(map[""]) // expect: empty string diff --git a/test/core/map/key_iterate.wren b/test/core/map/key_iterate.wren index f1b169a0..7a111358 100644 --- a/test/core/map/key_iterate.wren +++ b/test/core/map/key_iterate.wren @@ -4,23 +4,23 @@ var a = {"one": 1, "two": 2, "three": 3, "four": 4}.keys // entry table and the hashing process isn't specified. So we just validate // what we can assume about them. -IO.print(a.iterate(null) is Num) // expect: true -IO.print(a.iterate(null) >= 0) // expect: true +System.print(a.iterate(null) is Num) // expect: true +System.print(a.iterate(null) >= 0) // expect: true -IO.print(a.iterate(0) is Num) // expect: true -IO.print(a.iterate(0) > 0) // expect: true -IO.print(a.iterate(1) is Num) // expect: true -IO.print(a.iterate(1) > 0) // expect: true -IO.print(a.iterate(2) is Num) // expect: true -IO.print(a.iterate(2) > 0) // expect: true -IO.print(a.iterate(3) is Num) // expect: true -IO.print(a.iterate(3) > 0) // expect: true +System.print(a.iterate(0) is Num) // expect: true +System.print(a.iterate(0) > 0) // expect: true +System.print(a.iterate(1) is Num) // expect: true +System.print(a.iterate(1) > 0) // expect: true +System.print(a.iterate(2) is Num) // expect: true +System.print(a.iterate(2) > 0) // expect: true +System.print(a.iterate(3) is Num) // expect: true +System.print(a.iterate(3) > 0) // expect: true var previous = -1 var iterator = a.iterate(null) while (iterator) { - IO.print(iterator > previous) - IO.print(iterator is Num) + System.print(iterator > previous) + System.print(iterator is Num) previous = iterator iterator = a.iterate(iterator) } @@ -38,8 +38,8 @@ while (iterator) { // expect: true // Out of bounds. -IO.print(a.iterate(16)) // expect: false -IO.print(a.iterate(-1)) // expect: false +System.print(a.iterate(16)) // expect: false +System.print(a.iterate(-1)) // expect: false // Nothing to iterate in an empty map. -IO.print({}.keys.iterate(null)) // expect: false +System.print({}.keys.iterate(null)) // expect: false diff --git a/test/core/map/key_types.wren b/test/core/map/key_types.wren index 57ec3519..e6ec71dc 100644 --- a/test/core/map/key_types.wren +++ b/test/core/map/key_types.wren @@ -12,17 +12,17 @@ var map = { fiber: "fiber" } -IO.print(map[null]) // expect: null value -IO.print(map[true]) // expect: true value -IO.print(map[false]) // expect: false value -IO.print(map[0]) // expect: zero -IO.print(map[1.2]) // expect: 1 point 2 -IO.print(map[List]) // expect: list class -IO.print(map["null"]) // expect: string value -IO.print(map[1..3]) // expect: 1 to 3 -IO.print(map[fiber]) // expect: fiber +System.print(map[null]) // expect: null value +System.print(map[true]) // expect: true value +System.print(map[false]) // expect: false value +System.print(map[0]) // expect: zero +System.print(map[1.2]) // expect: 1 point 2 +System.print(map[List]) // expect: list class +System.print(map["null"]) // expect: string value +System.print(map[1..3]) // expect: 1 to 3 +System.print(map[fiber]) // expect: fiber -IO.print(map.count) // expect: 9 +System.print(map.count) // expect: 9 // Use the same keys (but sometimes different objects) to ensure keys have the // right equality semantics. @@ -35,13 +35,13 @@ map[[].type] = "new list class" map["nu" + "ll"] = "new string value" map[(3 - 2)..(1 + 2)] = "new 1 to 3" -IO.print(map[null]) // expect: new null value -IO.print(map[true]) // expect: new true value -IO.print(map[false]) // expect: new false value -IO.print(map[0]) // expect: new zero -IO.print(map[1.2]) // expect: new 1 point 2 -IO.print(map[List]) // expect: new list class -IO.print(map["null"]) // expect: new string value -IO.print(map[1..3]) // expect: new 1 to 3 +System.print(map[null]) // expect: new null value +System.print(map[true]) // expect: new true value +System.print(map[false]) // expect: new false value +System.print(map[0]) // expect: new zero +System.print(map[1.2]) // expect: new 1 point 2 +System.print(map[List]) // expect: new list class +System.print(map["null"]) // expect: new string value +System.print(map[1..3]) // expect: new 1 to 3 -IO.print(map.count) // expect: 9 +System.print(map.count) // expect: 9 diff --git a/test/core/map/new.wren b/test/core/map/new.wren index 557ee40c..1f917078 100644 --- a/test/core/map/new.wren +++ b/test/core/map/new.wren @@ -1,4 +1,4 @@ var map = Map.new() -IO.print(map.count) // expect: 0 -IO.print(map) // expect: {} +System.print(map.count) // expect: 0 +System.print(map) // expect: {} diff --git a/test/core/map/remove.wren b/test/core/map/remove.wren index ce5a9d4d..53bff7c4 100644 --- a/test/core/map/remove.wren +++ b/test/core/map/remove.wren @@ -4,15 +4,15 @@ var map = { "three": 3 } -IO.print(map.count) // expect: 3 -IO.print(map.remove("two")) // expect: 2 -IO.print(map.count) // expect: 2 -IO.print(map.remove("three")) // expect: 3 -IO.print(map.count) // expect: 1 +System.print(map.count) // expect: 3 +System.print(map.remove("two")) // expect: 2 +System.print(map.count) // expect: 2 +System.print(map.remove("three")) // expect: 3 +System.print(map.count) // expect: 1 // Remove an already removed entry. -IO.print(map.remove("two")) // expect: null -IO.print(map.count) // expect: 1 +System.print(map.remove("two")) // expect: null +System.print(map.count) // expect: 1 -IO.print(map.remove("one")) // expect: 1 -IO.print(map.count) // expect: 0 +System.print(map.remove("one")) // expect: 1 +System.print(map.count) // expect: 0 diff --git a/test/core/map/subscript_empty_map.wren b/test/core/map/subscript_empty_map.wren index bd453aae..05ee6680 100644 --- a/test/core/map/subscript_empty_map.wren +++ b/test/core/map/subscript_empty_map.wren @@ -1,4 +1,4 @@ // This is a regression test to ensure map handles a null entry array. var map = {} -IO.print(map["key"]) // expect: null +System.print(map["key"]) // expect: null diff --git a/test/core/map/to_string.wren b/test/core/map/to_string.wren index 66a951b4..370d3979 100644 --- a/test/core/map/to_string.wren +++ b/test/core/map/to_string.wren @@ -1,11 +1,11 @@ // Handle empty map. -IO.print({}.toString) // expect: {} +System.print({}.toString) // expect: {} // Does not quote strings. -IO.print({"1": "2"}.toString) // expect: {1: 2} +System.print({"1": "2"}.toString) // expect: {1: 2} // Nested maps. -IO.print({1: {2: {}}}) // expect: {1: {2: {}}} +System.print({1: {2: {}}}) // expect: {1: {2: {}}} // Calls toString on elements. class Foo { @@ -13,12 +13,12 @@ class Foo { toString { "Foo.toString" } } -IO.print({1: Foo.new()}) // expect: {1: Foo.toString} +System.print({1: Foo.new()}) // expect: {1: Foo.toString} // Since iteration order is unspecified, we don't know what order the results // will be. var s = {1: 2, 3: 4, 5: 6}.toString -IO.print(s == "{1: 2, 3: 4, 5: 6}" || +System.print(s == "{1: 2, 3: 4, 5: 6}" || s == "{1: 2, 5: 6, 3: 4}" || s == "{3: 4, 1: 2, 5: 6}" || s == "{3: 4, 5: 6, 1: 2}" || diff --git a/test/core/map/type.wren b/test/core/map/type.wren index 11e4913b..63507b32 100644 --- a/test/core/map/type.wren +++ b/test/core/map/type.wren @@ -1,5 +1,5 @@ -IO.print({} is Map) // expect: true +System.print({} is Map) // expect: true // TODO: Abstract base class for associations. -IO.print({} is Object) // expect: true -IO.print({} is Bool) // expect: false -IO.print({}.type == Map) // expect: true +System.print({} is Object) // expect: true +System.print({} is Bool) // expect: false +System.print({}.type == Map) // expect: true diff --git a/test/core/map/value_iterate.wren b/test/core/map/value_iterate.wren index cf185abf..7026164e 100644 --- a/test/core/map/value_iterate.wren +++ b/test/core/map/value_iterate.wren @@ -4,23 +4,23 @@ var a = {"one": 1, "two": 2, "three": 3, "four": 4}.values // entry table and the hashing process isn't specified. So we just validate // what we can assume about them. -IO.print(a.iterate(null) is Num) // expect: true -IO.print(a.iterate(null) >= 0) // expect: true +System.print(a.iterate(null) is Num) // expect: true +System.print(a.iterate(null) >= 0) // expect: true -IO.print(a.iterate(0) is Num) // expect: true -IO.print(a.iterate(0) > 0) // expect: true -IO.print(a.iterate(1) is Num) // expect: true -IO.print(a.iterate(1) > 0) // expect: true -IO.print(a.iterate(2) is Num) // expect: true -IO.print(a.iterate(2) > 0) // expect: true -IO.print(a.iterate(3) is Num) // expect: true -IO.print(a.iterate(3) > 0) // expect: true +System.print(a.iterate(0) is Num) // expect: true +System.print(a.iterate(0) > 0) // expect: true +System.print(a.iterate(1) is Num) // expect: true +System.print(a.iterate(1) > 0) // expect: true +System.print(a.iterate(2) is Num) // expect: true +System.print(a.iterate(2) > 0) // expect: true +System.print(a.iterate(3) is Num) // expect: true +System.print(a.iterate(3) > 0) // expect: true var previous = -1 var iterator = a.iterate(null) while (iterator) { - IO.print(iterator > previous) - IO.print(iterator is Num) + System.print(iterator > previous) + System.print(iterator is Num) previous = iterator iterator = a.iterate(iterator) } @@ -38,8 +38,8 @@ while (iterator) { // expect: true // Out of bounds. -IO.print(a.iterate(16)) // expect: false -IO.print(a.iterate(-1)) // expect: false +System.print(a.iterate(16)) // expect: false +System.print(a.iterate(-1)) // expect: false // Nothing to iterate in an empty map. -IO.print({}.values.iterate(null)) // expect: false +System.print({}.values.iterate(null)) // expect: false diff --git a/test/core/null/not.wren b/test/core/null/not.wren index 630200d3..6219e0ec 100644 --- a/test/core/null/not.wren +++ b/test/core/null/not.wren @@ -1 +1 @@ -IO.print(!null) // expect: true +System.print(!null) // expect: true diff --git a/test/core/null/type.wren b/test/core/null/type.wren index 3fdb2628..64c2781c 100644 --- a/test/core/null/type.wren +++ b/test/core/null/type.wren @@ -1,4 +1,4 @@ -IO.print(null is Null) // expect: true -IO.print(null is Object) // expect: true -IO.print(null is Bool) // expect: false -IO.print(null.type == Null) // expect: true +System.print(null is Null) // expect: true +System.print(null is Object) // expect: true +System.print(null is Bool) // expect: false +System.print(null.type == Null) // expect: true diff --git a/test/core/number/abs.wren b/test/core/number/abs.wren index 171b3ebb..eb4a4777 100644 --- a/test/core/number/abs.wren +++ b/test/core/number/abs.wren @@ -1,6 +1,6 @@ -IO.print(123.abs) // expect: 123 -IO.print((-123).abs) // expect: 123 -IO.print(0.abs) // expect: 0 -IO.print((-0).abs) // expect: 0 -IO.print((-0.12).abs) // expect: 0.12 -IO.print(12.34.abs) // expect: 12.34 +System.print(123.abs) // expect: 123 +System.print((-123).abs) // expect: 123 +System.print(0.abs) // expect: 0 +System.print((-0).abs) // expect: 0 +System.print((-0.12).abs) // expect: 0.12 +System.print(12.34.abs) // expect: 12.34 diff --git a/test/core/number/acos.wren b/test/core/number/acos.wren index 54d54da9..94138b18 100644 --- a/test/core/number/acos.wren +++ b/test/core/number/acos.wren @@ -1,3 +1,3 @@ -IO.print(0.acos) // expect: 1.5707963267949 -IO.print(1.acos) // expect: 0 -IO.print((-1).acos) // expect: 3.1415926535898 +System.print(0.acos) // expect: 1.5707963267949 +System.print(1.acos) // expect: 0 +System.print((-1).acos) // expect: 3.1415926535898 diff --git a/test/core/number/asin.wren b/test/core/number/asin.wren index e6c312af..bf6be347 100644 --- a/test/core/number/asin.wren +++ b/test/core/number/asin.wren @@ -1,3 +1,3 @@ -IO.print(0.asin) // expect: 0 -IO.print(1.asin) // expect: 1.5707963267949 -IO.print((-1).asin) // expect: -1.5707963267949 +System.print(0.asin) // expect: 0 +System.print(1.asin) // expect: 1.5707963267949 +System.print((-1).asin) // expect: -1.5707963267949 diff --git a/test/core/number/atan.wren b/test/core/number/atan.wren index 822315d7..89445907 100644 --- a/test/core/number/atan.wren +++ b/test/core/number/atan.wren @@ -1,2 +1,2 @@ -IO.print(0.atan) // expect: 0 -IO.print(1.atan) // expect: 0.78539816339745 +System.print(0.atan) // expect: 0 +System.print(1.atan) // expect: 0.78539816339745 diff --git a/test/core/number/atan2.wren b/test/core/number/atan2.wren index e1f5289f..d9354cbf 100644 --- a/test/core/number/atan2.wren +++ b/test/core/number/atan2.wren @@ -1,4 +1,4 @@ -IO.print(0.atan(0)) // expect: 0 -IO.print(0.atan(1)) // expect: 0 +System.print(0.atan(0)) // expect: 0 +System.print(0.atan(1)) // expect: 0 -IO.print(1.atan(0)) // expect: 1.5707963267949 +System.print(1.atan(0)) // expect: 1.5707963267949 diff --git a/test/core/number/bitwise_and.wren b/test/core/number/bitwise_and.wren index c63ff382..4199ba17 100644 --- a/test/core/number/bitwise_and.wren +++ b/test/core/number/bitwise_and.wren @@ -1,12 +1,12 @@ -IO.print(0 & 0) // expect: 0 -IO.print(2863311530 & 1431655765) // expect: 0 -IO.print(4042322160 & 1010580540) // expect: 808464432 +System.print(0 & 0) // expect: 0 +System.print(2863311530 & 1431655765) // expect: 0 +System.print(4042322160 & 1010580540) // expect: 808464432 // Max u32 value. -IO.print(4294967295 & 4294967295) // expect: 4294967295 +System.print(4294967295 & 4294967295) // expect: 4294967295 // Past max u32 value. -IO.print(4294967296 & 4294967296) // expect: 0 +System.print(4294967296 & 4294967296) // expect: 0 // TODO: Negative numbers. // TODO: Floating-point numbers. diff --git a/test/core/number/bitwise_lsh.wren b/test/core/number/bitwise_lsh.wren index 28d1e74d..8252b813 100644 --- a/test/core/number/bitwise_lsh.wren +++ b/test/core/number/bitwise_lsh.wren @@ -1,15 +1,15 @@ -IO.print(0 << 0) // expect: 0 -IO.print(1 << 0) // expect: 1 -IO.print(0 << 1) // expect: 0 -IO.print(1 << 1) // expect: 2 -IO.print(2863311530 << 1) // expect: 1431655764 -IO.print(4042322160 << 1) // expect: 3789677024 +System.print(0 << 0) // expect: 0 +System.print(1 << 0) // expect: 1 +System.print(0 << 1) // expect: 0 +System.print(1 << 1) // expect: 2 +System.print(2863311530 << 1) // expect: 1431655764 +System.print(4042322160 << 1) // expect: 3789677024 // Max u32 value. -IO.print(4294967295 << 1) // expect: 4294967294 +System.print(4294967295 << 1) // expect: 4294967294 // Past max u32 value. -IO.print(4294967296 << 1) // expect: 0 +System.print(4294967296 << 1) // expect: 0 // TODO: Negative numbers. // TODO: Floating-point numbers. diff --git a/test/core/number/bitwise_not.wren b/test/core/number/bitwise_not.wren index 06676c4a..9c1f5b36 100644 --- a/test/core/number/bitwise_not.wren +++ b/test/core/number/bitwise_not.wren @@ -1,22 +1,22 @@ -IO.print(~0) // expect: 4294967295 -IO.print(~1) // expect: 4294967294 -IO.print(~23) // expect: 4294967272 +System.print(~0) // expect: 4294967295 +System.print(~1) // expect: 4294967294 +System.print(~23) // expect: 4294967272 // Max u32 value. -IO.print(~4294967295) // expect: 0 +System.print(~4294967295) // expect: 0 // Past max u32 value. -IO.print(~4294967296) // expect: 4294967295 +System.print(~4294967296) // expect: 4294967295 // Negative numbers. -IO.print(~-1) // expect: 0 -IO.print(~-123) // expect: 122 -IO.print(~-4294967294) // expect: 4294967293 -IO.print(~-4294967295) // expect: 4294967294 -IO.print(~-4294967296) // expect: 4294967295 +System.print(~-1) // expect: 0 +System.print(~-123) // expect: 122 +System.print(~-4294967294) // expect: 4294967293 +System.print(~-4294967295) // expect: 4294967294 +System.print(~-4294967296) // expect: 4294967295 // Floating point values. -IO.print(~1.23) // expect: 4294967294 -IO.print(~0.00123) // expect: 4294967295 -IO.print(~345.67) // expect: 4294966950 -IO.print(~-12.34) // expect: 11 +System.print(~1.23) // expect: 4294967294 +System.print(~0.00123) // expect: 4294967295 +System.print(~345.67) // expect: 4294966950 +System.print(~-12.34) // expect: 11 diff --git a/test/core/number/bitwise_or.wren b/test/core/number/bitwise_or.wren index 6cf75cdb..5fe087ab 100644 --- a/test/core/number/bitwise_or.wren +++ b/test/core/number/bitwise_or.wren @@ -1,12 +1,12 @@ -IO.print(0 | 0) // expect: 0 -IO.print(2863311530 | 1431655765) // expect: 4294967295 -IO.print(3435973836 | 1717986918) // expect: 4008636142 +System.print(0 | 0) // expect: 0 +System.print(2863311530 | 1431655765) // expect: 4294967295 +System.print(3435973836 | 1717986918) // expect: 4008636142 // Max u32 value. -IO.print(4294967295 | 4294967295) // expect: 4294967295 +System.print(4294967295 | 4294967295) // expect: 4294967295 // Past max u32 value. -IO.print(4294967296 | 4294967296) // expect: 0 +System.print(4294967296 | 4294967296) // expect: 0 // TODO: Negative numbers. // TODO: Floating-point numbers. diff --git a/test/core/number/bitwise_rsh.wren b/test/core/number/bitwise_rsh.wren index 18c5892d..57beaf83 100644 --- a/test/core/number/bitwise_rsh.wren +++ b/test/core/number/bitwise_rsh.wren @@ -1,15 +1,15 @@ -IO.print(0 >> 0) // expect: 0 -IO.print(1 >> 0) // expect: 1 -IO.print(0 >> 1) // expect: 0 -IO.print(1 >> 1) // expect: 0 -IO.print(2863311530 >> 1) // expect: 1431655765 -IO.print(4042322160 >> 1) // expect: 2021161080 +System.print(0 >> 0) // expect: 0 +System.print(1 >> 0) // expect: 1 +System.print(0 >> 1) // expect: 0 +System.print(1 >> 1) // expect: 0 +System.print(2863311530 >> 1) // expect: 1431655765 +System.print(4042322160 >> 1) // expect: 2021161080 // Max u32 value. -IO.print(4294967295 >> 1) // expect: 2147483647 +System.print(4294967295 >> 1) // expect: 2147483647 // Past max u32 value. -IO.print(4294967296 >> 1) // expect: 0 +System.print(4294967296 >> 1) // expect: 0 // TODO: Negative numbers. // TODO: Floating-point numbers. diff --git a/test/core/number/bitwise_xor.wren b/test/core/number/bitwise_xor.wren index 49530eda..039d4132 100644 --- a/test/core/number/bitwise_xor.wren +++ b/test/core/number/bitwise_xor.wren @@ -1,15 +1,15 @@ -IO.print(0 ^ 0) // expect: 0 -IO.print(1 ^ 1) // expect: 0 -IO.print(0 ^ 1) // expect: 1 -IO.print(1 ^ 0) // expect: 1 -IO.print(2863311530 ^ 1431655765) // expect: 4294967295 -IO.print(4042322160 ^ 1010580540) // expect: 3435973836 +System.print(0 ^ 0) // expect: 0 +System.print(1 ^ 1) // expect: 0 +System.print(0 ^ 1) // expect: 1 +System.print(1 ^ 0) // expect: 1 +System.print(2863311530 ^ 1431655765) // expect: 4294967295 +System.print(4042322160 ^ 1010580540) // expect: 3435973836 // Max u32 value. -IO.print(4294967295 ^ 4294967295) // expect: 0 +System.print(4294967295 ^ 4294967295) // expect: 0 // Past max u32 value. -IO.print(4294967296 ^ 4294967296) // expect: 0 +System.print(4294967296 ^ 4294967296) // expect: 0 // TODO: Negative numbers. // TODO: Floating-point numbers. diff --git a/test/core/number/ceil.wren b/test/core/number/ceil.wren index fe510dbd..6bddecee 100644 --- a/test/core/number/ceil.wren +++ b/test/core/number/ceil.wren @@ -1,8 +1,8 @@ -IO.print(123.ceil) // expect: 123 -IO.print((-123).ceil) // expect: -123 -IO.print(0.ceil) // expect: 0 -IO.print((-0).ceil) // expect: -0 -IO.print(0.123.ceil) // expect: 1 -IO.print(12.3.ceil) // expect: 13 -IO.print((-0.123).ceil) // expect: -0 -IO.print((-12.3).ceil) // expect: -12 +System.print(123.ceil) // expect: 123 +System.print((-123).ceil) // expect: -123 +System.print(0.ceil) // expect: 0 +System.print((-0).ceil) // expect: -0 +System.print(0.123.ceil) // expect: 1 +System.print(12.3.ceil) // expect: 13 +System.print((-0.123).ceil) // expect: -0 +System.print((-12.3).ceil) // expect: -12 diff --git a/test/core/number/comparison.wren b/test/core/number/comparison.wren index 8cee6c47..c71bf11d 100644 --- a/test/core/number/comparison.wren +++ b/test/core/number/comparison.wren @@ -1,27 +1,27 @@ -IO.print(1 < 2) // expect: true -IO.print(2 < 2) // expect: false -IO.print(2 < 1) // expect: false +System.print(1 < 2) // expect: true +System.print(2 < 2) // expect: false +System.print(2 < 1) // expect: false -IO.print(1 <= 2) // expect: true -IO.print(2 <= 2) // expect: true -IO.print(2 <= 1) // expect: false +System.print(1 <= 2) // expect: true +System.print(2 <= 2) // expect: true +System.print(2 <= 1) // expect: false -IO.print(1 > 2) // expect: false -IO.print(2 > 2) // expect: false -IO.print(2 > 1) // expect: true +System.print(1 > 2) // expect: false +System.print(2 > 2) // expect: false +System.print(2 > 1) // expect: true -IO.print(1 >= 2) // expect: false -IO.print(2 >= 2) // expect: true -IO.print(2 >= 1) // expect: true +System.print(1 >= 2) // expect: false +System.print(2 >= 2) // expect: true +System.print(2 >= 1) // expect: true // Zero and negative zero compare the same. -IO.print(0 < -0) // expect: false -IO.print(-0 < 0) // expect: false -IO.print(0 > -0) // expect: false -IO.print(-0 > 0) // expect: false -IO.print(0 <= -0) // expect: true -IO.print(-0 <= 0) // expect: true -IO.print(0 >= -0) // expect: true -IO.print(-0 >= 0) // expect: true +System.print(0 < -0) // expect: false +System.print(-0 < 0) // expect: false +System.print(0 > -0) // expect: false +System.print(-0 > 0) // expect: false +System.print(0 <= -0) // expect: true +System.print(-0 <= 0) // expect: true +System.print(0 >= -0) // expect: true +System.print(-0 >= 0) // expect: true // TODO: Wrong type for RHS. diff --git a/test/core/number/cos.wren b/test/core/number/cos.wren index b7be49af..b7672271 100644 --- a/test/core/number/cos.wren +++ b/test/core/number/cos.wren @@ -1,6 +1,6 @@ -IO.print(0.cos) // expect: 1 -IO.print(Num.pi.cos) // expect: -1 -IO.print((2 * Num.pi).cos) // expect: 1 +System.print(0.cos) // expect: 1 +System.print(Num.pi.cos) // expect: -1 +System.print((2 * Num.pi).cos) // expect: 1 // this should of course be 0, but it's not that precise -IO.print((Num.pi / 2).cos) // expect: 6.1232339957368e-17 +System.print((Num.pi / 2).cos) // expect: 6.1232339957368e-17 diff --git a/test/core/number/divide.wren b/test/core/number/divide.wren index 85aef751..5a3966a6 100644 --- a/test/core/number/divide.wren +++ b/test/core/number/divide.wren @@ -1,12 +1,12 @@ -IO.print(8 / 2) // expect: 4 -IO.print(12.34 / -0.4) // expect: -30.85 +System.print(8 / 2) // expect: 4 +System.print(12.34 / -0.4) // expect: -30.85 // Divide by zero. -IO.print(3 / 0) // expect: infinity -IO.print(-3 / 0) // expect: -infinity -IO.print(0 / 0) // expect: nan -IO.print(-0 / 0) // expect: nan -IO.print(3 / -0) // expect: -infinity -IO.print(-3 / -0) // expect: infinity -IO.print(0 / -0) // expect: nan -IO.print(-0 / -0) // expect: nan +System.print(3 / 0) // expect: infinity +System.print(-3 / 0) // expect: -infinity +System.print(0 / 0) // expect: nan +System.print(-0 / 0) // expect: nan +System.print(3 / -0) // expect: -infinity +System.print(-3 / -0) // expect: infinity +System.print(0 / -0) // expect: nan +System.print(-0 / -0) // expect: nan diff --git a/test/core/number/equality.wren b/test/core/number/equality.wren index 9b777037..ee7e29c7 100644 --- a/test/core/number/equality.wren +++ b/test/core/number/equality.wren @@ -1,19 +1,19 @@ -IO.print(123 == 123) // expect: true -IO.print(123 == 124) // expect: false -IO.print(-3 == 3) // expect: false -IO.print(0 == -0) // expect: true +System.print(123 == 123) // expect: true +System.print(123 == 124) // expect: false +System.print(-3 == 3) // expect: false +System.print(0 == -0) // expect: true // Not equal to other types. -IO.print(123 == "123") // expect: false -IO.print(1 == true) // expect: false -IO.print(0 == false) // expect: false +System.print(123 == "123") // expect: false +System.print(1 == true) // expect: false +System.print(0 == false) // expect: false -IO.print(123 != 123) // expect: false -IO.print(123 != 124) // expect: true -IO.print(-3 != 3) // expect: true -IO.print(0 != -0) // expect: false +System.print(123 != 123) // expect: false +System.print(123 != 124) // expect: true +System.print(-3 != 3) // expect: true +System.print(0 != -0) // expect: false // Not equal to other types. -IO.print(123 != "123") // expect: true -IO.print(1 != true) // expect: true -IO.print(0 != false) // expect: true +System.print(123 != "123") // expect: true +System.print(1 != true) // expect: true +System.print(0 != false) // expect: true diff --git a/test/core/number/floor.wren b/test/core/number/floor.wren index 063f0361..985809f4 100644 --- a/test/core/number/floor.wren +++ b/test/core/number/floor.wren @@ -1,8 +1,8 @@ -IO.print(123.floor) // expect: 123 -IO.print((-123).floor) // expect: -123 -IO.print(0.floor) // expect: 0 -IO.print((-0).floor) // expect: -0 -IO.print(0.123.floor) // expect: 0 -IO.print(12.3.floor) // expect: 12 -IO.print((-0.123).floor) // expect: -1 -IO.print((-12.3).floor) // expect: -13 +System.print(123.floor) // expect: 123 +System.print((-123).floor) // expect: -123 +System.print(0.floor) // expect: 0 +System.print((-0).floor) // expect: -0 +System.print(0.123.floor) // expect: 0 +System.print(12.3.floor) // expect: 12 +System.print((-0.123).floor) // expect: -1 +System.print((-12.3).floor) // expect: -13 diff --git a/test/core/number/fraction.wren b/test/core/number/fraction.wren index 33be0dea..9af87ce5 100644 --- a/test/core/number/fraction.wren +++ b/test/core/number/fraction.wren @@ -1,19 +1,19 @@ -IO.print(123.fraction) // expect: 0 -IO.print((-123).fraction) // expect: -0 -IO.print(0.fraction) // expect: 0 -IO.print((-0).fraction) // expect: -0 -IO.print(0.123.fraction) // expect: 0.123 -IO.print(12.3.fraction) // expect: 0.3 -IO.print((-0.123).fraction) // expect: -0.123 -IO.print((-12.3).fraction) // expect: -0.3 +System.print(123.fraction) // expect: 0 +System.print((-123).fraction) // expect: -0 +System.print(0.fraction) // expect: 0 +System.print((-0).fraction) // expect: -0 +System.print(0.123.fraction) // expect: 0.123 +System.print(12.3.fraction) // expect: 0.3 +System.print((-0.123).fraction) // expect: -0.123 +System.print((-12.3).fraction) // expect: -0.3 // Using 32-bit representation, a longer mantissa will lead to // approximation. -IO.print((1.23456789012345).fraction) // expect: 0.23456789012345 -IO.print((-1.23456789012345).fraction) // expect: -0.23456789012345 +System.print((1.23456789012345).fraction) // expect: 0.23456789012345 +System.print((-1.23456789012345).fraction) // expect: -0.23456789012345 -IO.print((0.000000000000000000000000000000000000000001).fraction) // expect: 1e-42 -IO.print((-0.000000000000000000000000000000000000000001).fraction) // expect: -1e-42 +System.print((0.000000000000000000000000000000000000000001).fraction) // expect: 1e-42 +System.print((-0.000000000000000000000000000000000000000001).fraction) // expect: -1e-42 -IO.print((1.000000000000000000000000000000000000000001).fraction) // expect: 0 -IO.print((-1.000000000000000000000000000000000000000001).fraction) // expect: -0 +System.print((1.000000000000000000000000000000000000000001).fraction) // expect: 0 +System.print((-1.000000000000000000000000000000000000000001).fraction) // expect: -0 diff --git a/test/core/number/from_string.wren b/test/core/number/from_string.wren index ef0ded91..30b47bbf 100644 --- a/test/core/number/from_string.wren +++ b/test/core/number/from_string.wren @@ -1,14 +1,14 @@ -IO.print(Num.fromString("123") == 123) // expect: true -IO.print(Num.fromString("-123") == -123) // expect: true -IO.print(Num.fromString("-0") == -0) // expect: true -IO.print(Num.fromString("12.34") == 12.34) // expect: true -IO.print(Num.fromString("-0.0001") == -0.0001) // expect: true -IO.print(Num.fromString(" 12 ") == 12) // expect: true +System.print(Num.fromString("123") == 123) // expect: true +System.print(Num.fromString("-123") == -123) // expect: true +System.print(Num.fromString("-0") == -0) // expect: true +System.print(Num.fromString("12.34") == 12.34) // expect: true +System.print(Num.fromString("-0.0001") == -0.0001) // expect: true +System.print(Num.fromString(" 12 ") == 12) // expect: true // Test some non-number literals and ensure they return null. -IO.print(Num.fromString("test1") == null) // expect: true -IO.print(Num.fromString("") == null) // expect: true -IO.print(Num.fromString("prefix1.2") == null) // expect: true -IO.print(Num.fromString("1.2suffix") == null) // expect: true +System.print(Num.fromString("test1") == null) // expect: true +System.print(Num.fromString("") == null) // expect: true +System.print(Num.fromString("prefix1.2") == null) // expect: true +System.print(Num.fromString("1.2suffix") == null) // expect: true // TODO: Parse hex and scientific numbers. diff --git a/test/core/number/is_nan.wren b/test/core/number/is_nan.wren index 8d036501..5013c452 100644 --- a/test/core/number/is_nan.wren +++ b/test/core/number/is_nan.wren @@ -1,5 +1,5 @@ -IO.print(1.isNan) // expect: false -IO.print((0/0).isNan) // expect: true +System.print(1.isNan) // expect: false +System.print((0/0).isNan) // expect: true // Infinity is not NaN. -IO.print((1/0).isNan) // expect: false +System.print((1/0).isNan) // expect: false diff --git a/test/core/number/minus.wren b/test/core/number/minus.wren index 3f5830be..bd59344f 100644 --- a/test/core/number/minus.wren +++ b/test/core/number/minus.wren @@ -1,8 +1,8 @@ // Infix. -IO.print(5 - 3) // expect: 2 -IO.print(3.1 - 0.24) // expect: 2.86 -IO.print(3 - 2 - 1) // expect: 0 +System.print(5 - 3) // expect: 2 +System.print(3.1 - 0.24) // expect: 2.86 +System.print(3 - 2 - 1) // expect: 0 // Unary negation. var a = 3 -IO.print(-a) // expect: -3 +System.print(-a) // expect: -3 diff --git a/test/core/number/mod.wren b/test/core/number/mod.wren index 30716a8c..67e35ade 100644 --- a/test/core/number/mod.wren +++ b/test/core/number/mod.wren @@ -1,17 +1,17 @@ -IO.print(5 % 3) // expect: 2 -IO.print(10 % 5) // expect: 0 -IO.print(-4 % 3) // expect: -1 -IO.print(4 % -3) // expect: 1 -IO.print(-4 % -3) // expect: -1 -IO.print(-4.2 % 3.1) // expect: -1.1 -IO.print(4.2 % -3.1) // expect: 1.1 -IO.print(-4.2 % -3.1) // expect: -1.1 +System.print(5 % 3) // expect: 2 +System.print(10 % 5) // expect: 0 +System.print(-4 % 3) // expect: -1 +System.print(4 % -3) // expect: 1 +System.print(-4 % -3) // expect: -1 +System.print(-4.2 % 3.1) // expect: -1.1 +System.print(4.2 % -3.1) // expect: 1.1 +System.print(-4.2 % -3.1) // expect: -1.1 // Left associative. -IO.print(13 % 7 % 4) // expect: 2 +System.print(13 % 7 % 4) // expect: 2 // Precedence. -IO.print(13 + 1 % 7) // expect: 14 +System.print(13 + 1 % 7) // expect: 14 // TODO: Unsupported RHS types. // TODO: Error on mod by zero. diff --git a/test/core/number/multiply.wren b/test/core/number/multiply.wren index bb615150..7705d63a 100644 --- a/test/core/number/multiply.wren +++ b/test/core/number/multiply.wren @@ -1,2 +1,2 @@ -IO.print(5 * 3) // expect: 15 -IO.print(12.34 * 0.3) // expect: 3.702 +System.print(5 * 3) // expect: 15 +System.print(12.34 * 0.3) // expect: 3.702 diff --git a/test/core/number/not.wren b/test/core/number/not.wren index 87fcd1da..0b296248 100644 --- a/test/core/number/not.wren +++ b/test/core/number/not.wren @@ -1,2 +1,2 @@ -IO.print(!123) // expect: false -IO.print(!0) // expect: false +System.print(!123) // expect: false +System.print(!0) // expect: false diff --git a/test/core/number/plus.wren b/test/core/number/plus.wren index 5b5290b7..14385494 100644 --- a/test/core/number/plus.wren +++ b/test/core/number/plus.wren @@ -1,3 +1,3 @@ -IO.print(1 + 2) // expect: 3 -IO.print(12.34 + 0.13) // expect: 12.47 -IO.print(3 + 5 + 2) // expect: 10 +System.print(1 + 2) // expect: 3 +System.print(12.34 + 0.13) // expect: 12.47 +System.print(3 + 5 + 2) // expect: 10 diff --git a/test/core/number/sign.wren b/test/core/number/sign.wren index b6546901..e728cb10 100644 --- a/test/core/number/sign.wren +++ b/test/core/number/sign.wren @@ -1,6 +1,6 @@ -IO.print(123.sign) // expect: 1 -IO.print((-123).sign) // expect: -1 -IO.print(0.sign) // expect: 0 -IO.print((-0).sign) // expect: 0 -IO.print(0.123.sign) // expect: 1 -IO.print((-0.123).sign) // expect: -1 +System.print(123.sign) // expect: 1 +System.print((-123).sign) // expect: -1 +System.print(0.sign) // expect: 0 +System.print((-0).sign) // expect: 0 +System.print(0.123.sign) // expect: 1 +System.print((-0.123).sign) // expect: -1 diff --git a/test/core/number/sin.wren b/test/core/number/sin.wren index da2218e9..e83c1073 100644 --- a/test/core/number/sin.wren +++ b/test/core/number/sin.wren @@ -1,6 +1,6 @@ -IO.print(0.sin) // expect: 0 -IO.print((Num.pi / 2).sin) // expect: 1 +System.print(0.sin) // expect: 0 +System.print((Num.pi / 2).sin) // expect: 1 // these should of course be 0, but it's not that precise -IO.print(Num.pi.sin) // expect: 1.2246467991474e-16 -IO.print((2 * Num.pi).sin) // expect: -2.4492935982947e-16 +System.print(Num.pi.sin) // expect: 1.2246467991474e-16 +System.print((2 * Num.pi).sin) // expect: -2.4492935982947e-16 diff --git a/test/core/number/sqrt.wren b/test/core/number/sqrt.wren index f14cf979..fb5591f9 100644 --- a/test/core/number/sqrt.wren +++ b/test/core/number/sqrt.wren @@ -1,10 +1,10 @@ -IO.print(4.sqrt) // expect: 2 -IO.print(1000000.sqrt) // expect: 1000 -IO.print(1.sqrt) // expect: 1 -IO.print((-0).sqrt) // expect: -0 -IO.print(0.sqrt) // expect: 0 -IO.print(2.sqrt) // expect: 1.4142135623731 +System.print(4.sqrt) // expect: 2 +System.print(1000000.sqrt) // expect: 1000 +System.print(1.sqrt) // expect: 1 +System.print((-0).sqrt) // expect: -0 +System.print(0.sqrt) // expect: 0 +System.print(2.sqrt) // expect: 1.4142135623731 -IO.print((-4).sqrt.isNan) // expect: true +System.print((-4).sqrt.isNan) // expect: true // TODO: Tests for sin and cos. diff --git a/test/core/number/tan.wren b/test/core/number/tan.wren index 7173db4b..6e89ae2b 100644 --- a/test/core/number/tan.wren +++ b/test/core/number/tan.wren @@ -1,3 +1,3 @@ -IO.print(0.tan) // expect: 0 -IO.print((Num.pi / 4).tan) // expect: 1 -IO.print((-Num.pi / 4).tan) // expect: -1 +System.print(0.tan) // expect: 0 +System.print((Num.pi / 4).tan) // expect: 1 +System.print((-Num.pi / 4).tan) // expect: -1 diff --git a/test/core/number/to_string.wren b/test/core/number/to_string.wren index 4ba6f896..60c32c9c 100644 --- a/test/core/number/to_string.wren +++ b/test/core/number/to_string.wren @@ -1,5 +1,5 @@ -IO.print(123.toString == "123") // expect: true -IO.print((-123).toString == "-123") // expect: true -IO.print((-0).toString == "-0") // expect: true -IO.print(12.34.toString == "12.34") // expect: true -IO.print((-0.0001).toString == "-0.0001") // expect: true +System.print(123.toString == "123") // expect: true +System.print((-123).toString == "-123") // expect: true +System.print((-0).toString == "-0") // expect: true +System.print(12.34.toString == "12.34") // expect: true +System.print((-0.0001).toString == "-0.0001") // expect: true diff --git a/test/core/number/truncate.wren b/test/core/number/truncate.wren index dfc68c40..023d3d59 100644 --- a/test/core/number/truncate.wren +++ b/test/core/number/truncate.wren @@ -1,13 +1,13 @@ -IO.print(123.truncate) // expect: 123 -IO.print((-123).truncate) // expect: -123 -IO.print(0.truncate) // expect: 0 -IO.print((-0).truncate) // expect: -0 -IO.print(0.123.truncate) // expect: 0 -IO.print(12.3.truncate) // expect: 12 -IO.print((-0.123).truncate) // expect: -0 -IO.print((-12.3).truncate) // expect: -12 +System.print(123.truncate) // expect: 123 +System.print((-123).truncate) // expect: -123 +System.print(0.truncate) // expect: 0 +System.print((-0).truncate) // expect: -0 +System.print(0.123.truncate) // expect: 0 +System.print(12.3.truncate) // expect: 12 +System.print((-0.123).truncate) // expect: -0 +System.print((-12.3).truncate) // expect: -12 // Using 32-bit representation, values "beyond" those two will lead to // approximation. -IO.print((12345678901234.5).truncate) // expect: 12345678901234 -IO.print((-12345678901234.5).truncate) // expect: -12345678901234 +System.print((12345678901234.5).truncate) // expect: 12345678901234 +System.print((-12345678901234.5).truncate) // expect: -12345678901234 diff --git a/test/core/number/type.wren b/test/core/number/type.wren index bf7a65a8..9ff74651 100644 --- a/test/core/number/type.wren +++ b/test/core/number/type.wren @@ -1,4 +1,4 @@ -IO.print(123 is Num) // expect: true -IO.print(123 is Object) // expect: true -IO.print(123 is String) // expect: false -IO.print(123.type == Num) // expect: true +System.print(123 is Num) // expect: true +System.print(123 is Object) // expect: true +System.print(123 is String) // expect: false +System.print(123.type == Num) // expect: true diff --git a/test/core/object/not.wren b/test/core/object/not.wren index d658d6fb..ab97e577 100644 --- a/test/core/object/not.wren +++ b/test/core/object/not.wren @@ -1,4 +1,4 @@ class Foo { construct new() {} } -IO.print(!Foo.new()) // expect: false +System.print(!Foo.new()) // expect: false diff --git a/test/core/object/same.wren b/test/core/object/same.wren index 43b51494..9111aee8 100644 --- a/test/core/object/same.wren +++ b/test/core/object/same.wren @@ -1,27 +1,27 @@ // Value types compare by value. -IO.print(Object.same(true, true)) // expect: true -IO.print(Object.same(true, false)) // expect: false +System.print(Object.same(true, true)) // expect: true +System.print(Object.same(true, false)) // expect: false -IO.print(Object.same(null, null)) // expect: true +System.print(Object.same(null, null)) // expect: true -IO.print(Object.same(1 + 2, 2 + 1)) // expect: true -IO.print(Object.same(1 + 2, 2 + 2)) // expect: false +System.print(Object.same(1 + 2, 2 + 1)) // expect: true +System.print(Object.same(1 + 2, 2 + 2)) // expect: false -IO.print(Object.same(1..2, 1..2)) // expect: true -IO.print(Object.same(1..2, 1..3)) // expect: false +System.print(Object.same(1..2, 1..2)) // expect: true +System.print(Object.same(1..2, 1..3)) // expect: false -IO.print(Object.same("ab", "a" + "b")) // expect: true -IO.print(Object.same("ab", "a" + "c")) // expect: false +System.print(Object.same("ab", "a" + "b")) // expect: true +System.print(Object.same("ab", "a" + "c")) // expect: false // Different types are never the same. -IO.print(Object.same(null, false)) // expect: false -IO.print(Object.same(true, 2)) // expect: false -IO.print(Object.same(1..2, 2)) // expect: false -IO.print(Object.same("1", 1)) // expect: false +System.print(Object.same(null, false)) // expect: false +System.print(Object.same(true, 2)) // expect: false +System.print(Object.same(1..2, 2)) // expect: false +System.print(Object.same("1", 1)) // expect: false // Classes compare by identity. -IO.print(Object.same(Bool, Num)) // expect: false -IO.print(Object.same(Bool, Bool)) // expect: true +System.print(Object.same(Bool, Num)) // expect: false +System.print(Object.same(Bool, Bool)) // expect: true // Other types compare by identity. class Foo { @@ -29,8 +29,8 @@ class Foo { } var foo = Foo.new() -IO.print(Object.same(foo, foo)) // expect: true -IO.print(Object.same(foo, Foo.new())) // expect: false +System.print(Object.same(foo, foo)) // expect: true +System.print(Object.same(foo, Foo.new())) // expect: false // Ignores == operators. class Bar { @@ -39,5 +39,5 @@ class Bar { } var bar = Bar.new() -IO.print(Object.same(bar, bar)) // expect: true -IO.print(Object.same(bar, Bar.new())) // expect: false +System.print(Object.same(bar, bar)) // expect: true +System.print(Object.same(bar, Bar.new())) // expect: false diff --git a/test/core/object/to_string.wren b/test/core/object/to_string.wren index 59d44126..3037066e 100644 --- a/test/core/object/to_string.wren +++ b/test/core/object/to_string.wren @@ -1,4 +1,4 @@ class Foo { construct new() {} } -IO.print(Foo.new().toString == "instance of Foo") // expect: true +System.print(Foo.new().toString == "instance of Foo") // expect: true diff --git a/test/core/object/type.wren b/test/core/object/type.wren index db1c51cd..0e46c805 100644 --- a/test/core/object/type.wren +++ b/test/core/object/type.wren @@ -1,13 +1,13 @@ class Foo {} // Object's class is a class. -IO.print(Object is Class) // expect: true +System.print(Object is Class) // expect: true // Its metatype is also a class. -IO.print(Object.type is Class) // expect: true +System.print(Object.type is Class) // expect: true // The metatype's metatype is Class. -IO.print(Object.type.type == Class) // expect: true +System.print(Object.type.type == Class) // expect: true // Object has a distinct metaclass. -IO.print(Object.type.name) // expect: Object metaclass +System.print(Object.type.name) // expect: Object metaclass diff --git a/test/core/range/contains.wren b/test/core/range/contains.wren index 97189ef6..d6be1ea1 100644 --- a/test/core/range/contains.wren +++ b/test/core/range/contains.wren @@ -1,23 +1,23 @@ // Ordered range. -IO.print((2..5).contains(1)) // expect: false -IO.print((2..5).contains(2)) // expect: true -IO.print((2..5).contains(5)) // expect: true -IO.print((2..5).contains(6)) // expect: false +System.print((2..5).contains(1)) // expect: false +System.print((2..5).contains(2)) // expect: true +System.print((2..5).contains(5)) // expect: true +System.print((2..5).contains(6)) // expect: false // Backwards range. -IO.print((5..2).contains(1)) // expect: false -IO.print((5..2).contains(2)) // expect: true -IO.print((5..2).contains(5)) // expect: true -IO.print((5..2).contains(6)) // expect: false +System.print((5..2).contains(1)) // expect: false +System.print((5..2).contains(2)) // expect: true +System.print((5..2).contains(5)) // expect: true +System.print((5..2).contains(6)) // expect: false // Exclusive ordered range. -IO.print((2...5).contains(1)) // expect: false -IO.print((2...5).contains(2)) // expect: true -IO.print((2...5).contains(5)) // expect: false -IO.print((2...5).contains(6)) // expect: false +System.print((2...5).contains(1)) // expect: false +System.print((2...5).contains(2)) // expect: true +System.print((2...5).contains(5)) // expect: false +System.print((2...5).contains(6)) // expect: false // Exclusive backwards range. -IO.print((5...2).contains(1)) // expect: false -IO.print((5...2).contains(2)) // expect: false -IO.print((5...2).contains(5)) // expect: true -IO.print((5...2).contains(6)) // expect: false +System.print((5...2).contains(1)) // expect: false +System.print((5...2).contains(2)) // expect: false +System.print((5...2).contains(5)) // expect: true +System.print((5...2).contains(6)) // expect: false diff --git a/test/core/range/equality.wren b/test/core/range/equality.wren index a2e23d30..9cf77676 100644 --- a/test/core/range/equality.wren +++ b/test/core/range/equality.wren @@ -3,15 +3,15 @@ var b = 2..6 var c = 2...5 var d = 2...6 -IO.print(a == 2..5) // expect: true -IO.print(a == 2..6) // expect: false -IO.print(c == 2...5) // expect: true -IO.print(c == 2...6) // expect: false +System.print(a == 2..5) // expect: true +System.print(a == 2..6) // expect: false +System.print(c == 2...5) // expect: true +System.print(c == 2...6) // expect: false -IO.print(b != 2..5) // expect: true -IO.print(b != 2..6) // expect: false -IO.print(d != 2...5) // expect: true -IO.print(d != 2...6) // expect: false +System.print(b != 2..5) // expect: true +System.print(b != 2..6) // expect: false +System.print(d != 2...5) // expect: true +System.print(d != 2...6) // expect: false -IO.print(a != c) // expect: true -IO.print(b != d) // expect: true \ No newline at end of file +System.print(a != c) // expect: true +System.print(b != d) // expect: true \ No newline at end of file diff --git a/test/core/range/floating_point.wren b/test/core/range/floating_point.wren index 114ea1fb..78f7ff13 100644 --- a/test/core/range/floating_point.wren +++ b/test/core/range/floating_point.wren @@ -1,25 +1,25 @@ // Ordered range. -IO.print((2..5).from) // expect: 2 -IO.print((3..3).from) // expect: 3 -IO.print((0..3).from) // expect: 0 -IO.print((-5..3).from) // expect: -5 -IO.print((-5..-2).from) // expect: -5 +System.print((2..5).from) // expect: 2 +System.print((3..3).from) // expect: 3 +System.print((0..3).from) // expect: 0 +System.print((-5..3).from) // expect: -5 +System.print((-5..-2).from) // expect: -5 // Backwards range. -IO.print((5..2).from) // expect: 5 -IO.print((3..0).from) // expect: 3 -IO.print((3..-5).from) // expect: 3 -IO.print((-2..-5).from) // expect: -2 +System.print((5..2).from) // expect: 5 +System.print((3..0).from) // expect: 3 +System.print((3..-5).from) // expect: 3 +System.print((-2..-5).from) // expect: -2 // Exclusive ordered range. -IO.print((2...5).from) // expect: 2 -IO.print((3...3).from) // expect: 3 -IO.print((0...3).from) // expect: 0 -IO.print((-5...3).from) // expect: -5 -IO.print((-5...-2).from) // expect: -5 +System.print((2...5).from) // expect: 2 +System.print((3...3).from) // expect: 3 +System.print((0...3).from) // expect: 0 +System.print((-5...3).from) // expect: -5 +System.print((-5...-2).from) // expect: -5 // Exclusive backwards range. -IO.print((5...2).from) // expect: 5 -IO.print((3...0).from) // expect: 3 -IO.print((3...-5).from) // expect: 3 -IO.print((-2...-5).from) // expect: -2 +System.print((5...2).from) // expect: 5 +System.print((3...0).from) // expect: 3 +System.print((3...-5).from) // expect: 3 +System.print((-2...-5).from) // expect: -2 diff --git a/test/core/range/from.wren b/test/core/range/from.wren index 114ea1fb..78f7ff13 100644 --- a/test/core/range/from.wren +++ b/test/core/range/from.wren @@ -1,25 +1,25 @@ // Ordered range. -IO.print((2..5).from) // expect: 2 -IO.print((3..3).from) // expect: 3 -IO.print((0..3).from) // expect: 0 -IO.print((-5..3).from) // expect: -5 -IO.print((-5..-2).from) // expect: -5 +System.print((2..5).from) // expect: 2 +System.print((3..3).from) // expect: 3 +System.print((0..3).from) // expect: 0 +System.print((-5..3).from) // expect: -5 +System.print((-5..-2).from) // expect: -5 // Backwards range. -IO.print((5..2).from) // expect: 5 -IO.print((3..0).from) // expect: 3 -IO.print((3..-5).from) // expect: 3 -IO.print((-2..-5).from) // expect: -2 +System.print((5..2).from) // expect: 5 +System.print((3..0).from) // expect: 3 +System.print((3..-5).from) // expect: 3 +System.print((-2..-5).from) // expect: -2 // Exclusive ordered range. -IO.print((2...5).from) // expect: 2 -IO.print((3...3).from) // expect: 3 -IO.print((0...3).from) // expect: 0 -IO.print((-5...3).from) // expect: -5 -IO.print((-5...-2).from) // expect: -5 +System.print((2...5).from) // expect: 2 +System.print((3...3).from) // expect: 3 +System.print((0...3).from) // expect: 0 +System.print((-5...3).from) // expect: -5 +System.print((-5...-2).from) // expect: -5 // Exclusive backwards range. -IO.print((5...2).from) // expect: 5 -IO.print((3...0).from) // expect: 3 -IO.print((3...-5).from) // expect: 3 -IO.print((-2...-5).from) // expect: -2 +System.print((5...2).from) // expect: 5 +System.print((3...0).from) // expect: 3 +System.print((3...-5).from) // expect: 3 +System.print((-2...-5).from) // expect: -2 diff --git a/test/core/range/is_inclusive.wren b/test/core/range/is_inclusive.wren index 8f881aef..bd7e89fa 100644 --- a/test/core/range/is_inclusive.wren +++ b/test/core/range/is_inclusive.wren @@ -1,5 +1,5 @@ -IO.print((0..0).isInclusive) // expect: true -IO.print((0...0).isInclusive) // expect: false +System.print((0..0).isInclusive) // expect: true +System.print((0...0).isInclusive) // expect: false -IO.print((-1..1).isInclusive) // expect: true -IO.print((-1...1).isInclusive) // expect: false +System.print((-1..1).isInclusive) // expect: true +System.print((-1...1).isInclusive) // expect: false diff --git a/test/core/range/iterate.wren b/test/core/range/iterate.wren index db4e949d..3de968e9 100644 --- a/test/core/range/iterate.wren +++ b/test/core/range/iterate.wren @@ -1,35 +1,35 @@ // Inclusive. var range = 1..3 -IO.print(range.iterate(null)) // expect: 1 -IO.print(range.iterate(1)) // expect: 2 -IO.print(range.iterate(2)) // expect: 3 -IO.print(range.iterate(3)) // expect: false -IO.print(range.iterate(4)) // expect: false +System.print(range.iterate(null)) // expect: 1 +System.print(range.iterate(1)) // expect: 2 +System.print(range.iterate(2)) // expect: 3 +System.print(range.iterate(3)) // expect: false +System.print(range.iterate(4)) // expect: false // Exclusive range = 1...3 -IO.print(range.iterate(null)) // expect: 1 -IO.print(range.iterate(1)) // expect: 2 -IO.print(range.iterate(2)) // expect: false +System.print(range.iterate(null)) // expect: 1 +System.print(range.iterate(1)) // expect: 2 +System.print(range.iterate(2)) // expect: false // Negative inclusive range. range = 3..1 -IO.print(range.iterate(null)) // expect: 3 -IO.print(range.iterate(3)) // expect: 2 -IO.print(range.iterate(2)) // expect: 1 -IO.print(range.iterate(1)) // expect: false +System.print(range.iterate(null)) // expect: 3 +System.print(range.iterate(3)) // expect: 2 +System.print(range.iterate(2)) // expect: 1 +System.print(range.iterate(1)) // expect: false // Negative exclusive range. range = 3...1 -IO.print(range.iterate(null)) // expect: 3 -IO.print(range.iterate(3)) // expect: 2 -IO.print(range.iterate(2)) // expect: false +System.print(range.iterate(null)) // expect: 3 +System.print(range.iterate(3)) // expect: 2 +System.print(range.iterate(2)) // expect: false // Empty inclusive range. range = 1..1 -IO.print(range.iterate(null)) // expect: 1 -IO.print(range.iterate(1)) // expect: false +System.print(range.iterate(null)) // expect: 1 +System.print(range.iterate(1)) // expect: false // Empty exclusive range. range = 1...1 -IO.print(range.iterate(null)) // expect: false +System.print(range.iterate(null)) // expect: false diff --git a/test/core/range/iterate_from_float.wren b/test/core/range/iterate_from_float.wren index 23e7ca41..1e02c7de 100644 --- a/test/core/range/iterate_from_float.wren +++ b/test/core/range/iterate_from_float.wren @@ -1,18 +1,18 @@ // Starts at "from" and adds 1.0 each iteration. -for (n in 1.3..4.5) IO.print(n) +for (n in 1.3..4.5) System.print(n) // expect: 1.3 // expect: 2.3 // expect: 3.3 // expect: 4.3 -for (n in 1.3...4.5) IO.print(n) +for (n in 1.3...4.5) System.print(n) // expect: 1.3 // expect: 2.3 // expect: 3.3 // expect: 4.3 -for (n in 1.3...4.3) IO.print(n) +for (n in 1.3...4.3) System.print(n) // expect: 1.3 // expect: 2.3 // expect: 3.3 diff --git a/test/core/range/iterator_value.wren b/test/core/range/iterator_value.wren index 5274517e..28139701 100644 --- a/test/core/range/iterator_value.wren +++ b/test/core/range/iterator_value.wren @@ -1,11 +1,11 @@ var range = 1..3 -IO.print(range.iteratorValue(1)) // expect: 1 -IO.print(range.iteratorValue(2)) // expect: 2 -IO.print(range.iteratorValue(3)) // expect: 3 +System.print(range.iteratorValue(1)) // expect: 1 +System.print(range.iteratorValue(2)) // expect: 2 +System.print(range.iteratorValue(3)) // expect: 3 // Doesn't bother to bounds check. -IO.print(range.iteratorValue(-2)) // expect: -2 -IO.print(range.iteratorValue(5)) // expect: 5 +System.print(range.iteratorValue(-2)) // expect: -2 +System.print(range.iteratorValue(5)) // expect: 5 // Or type check. -IO.print(range.iteratorValue("s")) // expect: s +System.print(range.iteratorValue("s")) // expect: s diff --git a/test/core/range/join.wren b/test/core/range/join.wren index 81c336a1..46a58beb 100644 --- a/test/core/range/join.wren +++ b/test/core/range/join.wren @@ -1,4 +1,4 @@ var a = 1..3 -IO.print(a.join) // expect: 123 -IO.print(a.join(", ")) // expect: 1, 2, 3 +System.print(a.join) // expect: 123 +System.print(a.join(", ")) // expect: 1, 2, 3 diff --git a/test/core/range/map.wren b/test/core/range/map.wren index 2d65317e..1081c8b1 100644 --- a/test/core/range/map.wren +++ b/test/core/range/map.wren @@ -1,3 +1,3 @@ var a = 1..3 var b = a.map {|x| x + 1 }.toList -IO.print(b) // expect: [2, 3, 4] +System.print(b) // expect: [2, 3, 4] diff --git a/test/core/range/max.wren b/test/core/range/max.wren index 9c6672d2..70aa0b67 100644 --- a/test/core/range/max.wren +++ b/test/core/range/max.wren @@ -1,25 +1,25 @@ // Ordered range. -IO.print((2..5).max) // expect: 5 -IO.print((3..3).max) // expect: 3 -IO.print((0..3).max) // expect: 3 -IO.print((-5..3).max) // expect: 3 -IO.print((-5..-2).max) // expect: -2 +System.print((2..5).max) // expect: 5 +System.print((3..3).max) // expect: 3 +System.print((0..3).max) // expect: 3 +System.print((-5..3).max) // expect: 3 +System.print((-5..-2).max) // expect: -2 // Backwards range. -IO.print((5..2).max) // expect: 5 -IO.print((3..0).max) // expect: 3 -IO.print((3..-5).max) // expect: 3 -IO.print((-2..-5).max) // expect: -2 +System.print((5..2).max) // expect: 5 +System.print((3..0).max) // expect: 3 +System.print((3..-5).max) // expect: 3 +System.print((-2..-5).max) // expect: -2 // Exclusive ordered range. -IO.print((2...5).max) // expect: 5 -IO.print((3...3).max) // expect: 3 -IO.print((0...3).max) // expect: 3 -IO.print((-5...3).max) // expect: 3 -IO.print((-5...-2).max) // expect: -2 +System.print((2...5).max) // expect: 5 +System.print((3...3).max) // expect: 3 +System.print((0...3).max) // expect: 3 +System.print((-5...3).max) // expect: 3 +System.print((-5...-2).max) // expect: -2 // Exclusive backwards range. -IO.print((5...2).max) // expect: 5 -IO.print((3...0).max) // expect: 3 -IO.print((3...-5).max) // expect: 3 -IO.print((-2...-5).max) // expect: -2 +System.print((5...2).max) // expect: 5 +System.print((3...0).max) // expect: 3 +System.print((3...-5).max) // expect: 3 +System.print((-2...-5).max) // expect: -2 diff --git a/test/core/range/min.wren b/test/core/range/min.wren index bcc019bf..a6dcaa96 100644 --- a/test/core/range/min.wren +++ b/test/core/range/min.wren @@ -1,25 +1,25 @@ // Ordered range. -IO.print((2..5).min) // expect: 2 -IO.print((3..3).min) // expect: 3 -IO.print((0..3).min) // expect: 0 -IO.print((-5..3).min) // expect: -5 -IO.print((-5..-2).min) // expect: -5 +System.print((2..5).min) // expect: 2 +System.print((3..3).min) // expect: 3 +System.print((0..3).min) // expect: 0 +System.print((-5..3).min) // expect: -5 +System.print((-5..-2).min) // expect: -5 // Backwards range. -IO.print((5..2).min) // expect: 2 -IO.print((3..0).min) // expect: 0 -IO.print((3..-5).min) // expect: -5 -IO.print((-2..-5).min) // expect: -5 +System.print((5..2).min) // expect: 2 +System.print((3..0).min) // expect: 0 +System.print((3..-5).min) // expect: -5 +System.print((-2..-5).min) // expect: -5 // Exclusive ordered range. -IO.print((2...5).min) // expect: 2 -IO.print((3...3).min) // expect: 3 -IO.print((0...3).min) // expect: 0 -IO.print((-5...3).min) // expect: -5 -IO.print((-5...-2).min) // expect: -5 +System.print((2...5).min) // expect: 2 +System.print((3...3).min) // expect: 3 +System.print((0...3).min) // expect: 0 +System.print((-5...3).min) // expect: -5 +System.print((-5...-2).min) // expect: -5 // Exclusive backwards range. -IO.print((5...2).min) // expect: 2 -IO.print((3...0).min) // expect: 0 -IO.print((3...-5).min) // expect: -5 -IO.print((-2...-5).min) // expect: -5 +System.print((5...2).min) // expect: 2 +System.print((3...0).min) // expect: 0 +System.print((3...-5).min) // expect: -5 +System.print((-2...-5).min) // expect: -5 diff --git a/test/core/range/reduce.wren b/test/core/range/reduce.wren index 2df9c295..30e88b39 100644 --- a/test/core/range/reduce.wren +++ b/test/core/range/reduce.wren @@ -1,4 +1,4 @@ var range = 1..10 -IO.print(range.reduce {|a, b| a + b }) // expect: 55 -IO.print(range.reduce(100) {|a, b| a < b ? a : b }) // expect: 1 +System.print(range.reduce {|a, b| a + b }) // expect: 55 +System.print(range.reduce(100) {|a, b| a < b ? a : b }) // expect: 1 diff --git a/test/core/range/to.wren b/test/core/range/to.wren index ad3a5444..8a9d864b 100644 --- a/test/core/range/to.wren +++ b/test/core/range/to.wren @@ -1,25 +1,25 @@ // Ordered range. -IO.print((2..5).to) // expect: 5 -IO.print((3..3).to) // expect: 3 -IO.print((0..3).to) // expect: 3 -IO.print((-5..3).to) // expect: 3 -IO.print((-5..-2).to) // expect: -2 +System.print((2..5).to) // expect: 5 +System.print((3..3).to) // expect: 3 +System.print((0..3).to) // expect: 3 +System.print((-5..3).to) // expect: 3 +System.print((-5..-2).to) // expect: -2 // Backwards range. -IO.print((5..2).to) // expect: 2 -IO.print((3..0).to) // expect: 0 -IO.print((3..-5).to) // expect: -5 -IO.print((-2..-5).to) // expect: -5 +System.print((5..2).to) // expect: 2 +System.print((3..0).to) // expect: 0 +System.print((3..-5).to) // expect: -5 +System.print((-2..-5).to) // expect: -5 // Exclusive ordered range. -IO.print((2...5).to) // expect: 5 -IO.print((3...3).to) // expect: 3 -IO.print((0...3).to) // expect: 3 -IO.print((-5...3).to) // expect: 3 -IO.print((-5...-2).to) // expect: -2 +System.print((2...5).to) // expect: 5 +System.print((3...3).to) // expect: 3 +System.print((0...3).to) // expect: 3 +System.print((-5...3).to) // expect: 3 +System.print((-5...-2).to) // expect: -2 // Exclusive backwards range. -IO.print((5...2).to) // expect: 2 -IO.print((3...0).to) // expect: 0 -IO.print((3...-5).to) // expect: -5 -IO.print((-2...-5).to) // expect: -5 +System.print((5...2).to) // expect: 2 +System.print((3...0).to) // expect: 0 +System.print((3...-5).to) // expect: -5 +System.print((-2...-5).to) // expect: -5 diff --git a/test/core/range/to_string.wren b/test/core/range/to_string.wren index 795b0d3e..d3e6c698 100644 --- a/test/core/range/to_string.wren +++ b/test/core/range/to_string.wren @@ -1,7 +1,7 @@ -IO.print(1..3) // expect: 1..3 -IO.print(12345.6789..12345.6789) // expect: 12345.6789..12345.6789 -IO.print(-100..-300) // expect: -100..-300 +System.print(1..3) // expect: 1..3 +System.print(12345.6789..12345.6789) // expect: 12345.6789..12345.6789 +System.print(-100..-300) // expect: -100..-300 -IO.print(1...3) // expect: 1...3 -IO.print(12345.6789...12345.6789) // expect: 12345.6789...12345.6789 -IO.print(-100...-300) // expect: -100...-300 +System.print(1...3) // expect: 1...3 +System.print(12345.6789...12345.6789) // expect: 12345.6789...12345.6789 +System.print(-100...-300) // expect: -100...-300 diff --git a/test/core/range/type.wren b/test/core/range/type.wren index 56f5b85e..2f748b3a 100644 --- a/test/core/range/type.wren +++ b/test/core/range/type.wren @@ -1,7 +1,7 @@ var range = 2..5 -IO.print(range is Range) // expect: true -IO.print(range is Sequence) // expect: true -IO.print(range is Object) // expect: true -IO.print(range is String) // expect: false -IO.print(range.type == Range) // expect: true +System.print(range is Range) // expect: true +System.print(range is Sequence) // expect: true +System.print(range is Object) // expect: true +System.print(range is String) // expect: false +System.print(range.type == Range) // expect: true diff --git a/test/core/range/where.wren b/test/core/range/where.wren index 33aa9991..ce52210e 100644 --- a/test/core/range/where.wren +++ b/test/core/range/where.wren @@ -1,6 +1,6 @@ var a = 1..3 var b = a.where {|x| x > 1 }.toList -IO.print(b) // expect: [2, 3] +System.print(b) // expect: [2, 3] var c = a.where {|x| x > 10 }.toList -IO.print(c) // expect: [] +System.print(c) // expect: [] diff --git a/test/core/sequence/all.wren b/test/core/sequence/all.wren index 5b26f05a..265d20f8 100644 --- a/test/core/sequence/all.wren +++ b/test/core/sequence/all.wren @@ -1,10 +1,10 @@ var a = [1, 2, 3] -IO.print(a.all {|x| x > 1 }) // expect: false -IO.print(a.all {|x| x > 0 }) // expect: true -IO.print([].all {|x| false }) // expect: true +System.print(a.all {|x| x > 1 }) // expect: false +System.print(a.all {|x| x > 0 }) // expect: true +System.print([].all {|x| false }) // expect: true // Returns first falsey value. -IO.print(a.all {|x| x < 2 ? null : false }) // expect: null +System.print(a.all {|x| x < 2 ? null : false }) // expect: null // Returns last truthy value. -IO.print(a.all {|x| x }) // expect: 3 \ No newline at end of file +System.print(a.all {|x| x }) // expect: 3 \ No newline at end of file diff --git a/test/core/sequence/any.wren b/test/core/sequence/any.wren index c60d70c8..7ffac07a 100644 --- a/test/core/sequence/any.wren +++ b/test/core/sequence/any.wren @@ -1,10 +1,10 @@ var a = [1, 2, 3] -IO.print(a.any {|x| x > 3 }) // expect: false -IO.print(a.any {|x| x > 1 }) // expect: true -IO.print([].any {|x| true }) // expect: false +System.print(a.any {|x| x > 3 }) // expect: false +System.print(a.any {|x| x > 1 }) // expect: true +System.print([].any {|x| true }) // expect: false // Returns first truthy value. -IO.print(a.any {|x| x }) // expect: 1 +System.print(a.any {|x| x }) // expect: 1 // Returns last falsey value. -IO.print(a.any {|x| x < 2 ? null : false }) // expect: false +System.print(a.any {|x| x < 2 ? null : false }) // expect: false diff --git a/test/core/sequence/count.wren b/test/core/sequence/count.wren index 959026f8..05960819 100644 --- a/test/core/sequence/count.wren +++ b/test/core/sequence/count.wren @@ -10,4 +10,4 @@ class TestSequence is Sequence { iteratorValue(iterator) { iterator } } -IO.print(TestSequence.new().count) // expect: 10 +System.print(TestSequence.new().count) // expect: 10 diff --git a/test/core/sequence/is_empty.wren b/test/core/sequence/is_empty.wren index 5134d608..89513637 100644 --- a/test/core/sequence/is_empty.wren +++ b/test/core/sequence/is_empty.wren @@ -1,5 +1,5 @@ -IO.print([].isEmpty) // expect: true -IO.print([1].isEmpty) // expect: false +System.print([].isEmpty) // expect: true +System.print([1].isEmpty) // expect: false class InfiniteSequence is Sequence { construct new() {} @@ -8,4 +8,4 @@ class InfiniteSequence is Sequence { } // Should not try to iterate the whole sequence. -IO.print(InfiniteSequence.new().isEmpty) // expect: false +System.print(InfiniteSequence.new().isEmpty) // expect: false diff --git a/test/core/sequence/map.wren b/test/core/sequence/map.wren index cb9833a2..d963ff3d 100644 --- a/test/core/sequence/map.wren +++ b/test/core/sequence/map.wren @@ -29,20 +29,20 @@ class Fib is Sequence { var squareFib = Fib.new().map {|fib| fib * fib } var iterator = null -IO.print(squareFib is Sequence) // expect: true -IO.print(squareFib) // expect: instance of MapSequence +System.print(squareFib is Sequence) // expect: true +System.print(squareFib) // expect: instance of MapSequence iterator = squareFib.iterate(iterator) -IO.print(squareFib.iteratorValue(iterator)) // expect: 0 +System.print(squareFib.iteratorValue(iterator)) // expect: 0 iterator = squareFib.iterate(iterator) -IO.print(squareFib.iteratorValue(iterator)) // expect: 1 +System.print(squareFib.iteratorValue(iterator)) // expect: 1 iterator = squareFib.iterate(iterator) -IO.print(squareFib.iteratorValue(iterator)) // expect: 1 +System.print(squareFib.iteratorValue(iterator)) // expect: 1 iterator = squareFib.iterate(iterator) -IO.print(squareFib.iteratorValue(iterator)) // expect: 4 +System.print(squareFib.iteratorValue(iterator)) // expect: 4 iterator = squareFib.iterate(iterator) -IO.print(squareFib.iteratorValue(iterator)) // expect: 9 +System.print(squareFib.iteratorValue(iterator)) // expect: 9 diff --git a/test/core/sequence/to_list.wren b/test/core/sequence/to_list.wren index cdaf96ff..c92e13b8 100644 --- a/test/core/sequence/to_list.wren +++ b/test/core/sequence/to_list.wren @@ -10,4 +10,4 @@ class TestSequence is Sequence { iteratorValue(iterator) { iterator } } -IO.print(TestSequence.new().toList) // expect: [1, 2, 3] +System.print(TestSequence.new().toList) // expect: [1, 2, 3] diff --git a/test/core/sequence/where.wren b/test/core/sequence/where.wren index c40176fd..27e0e78b 100644 --- a/test/core/sequence/where.wren +++ b/test/core/sequence/where.wren @@ -29,14 +29,14 @@ class Fib is Sequence { var largeFibs = Fib.new().where {|fib| fib > 100 } var iterator = null -IO.print(largeFibs is Sequence) // expect: true -IO.print(largeFibs) // expect: instance of WhereSequence +System.print(largeFibs is Sequence) // expect: true +System.print(largeFibs) // expect: instance of WhereSequence iterator = largeFibs.iterate(iterator) -IO.print(largeFibs.iteratorValue(iterator)) // expect: 144 +System.print(largeFibs.iteratorValue(iterator)) // expect: 144 iterator = largeFibs.iterate(iterator) -IO.print(largeFibs.iteratorValue(iterator)) // expect: 233 +System.print(largeFibs.iteratorValue(iterator)) // expect: 233 iterator = largeFibs.iterate(iterator) -IO.print(largeFibs.iteratorValue(iterator)) // expect: 377 +System.print(largeFibs.iteratorValue(iterator)) // expect: 377 diff --git a/test/core/string/bytes.wren b/test/core/string/bytes.wren index f225a81f..b7dad585 100644 --- a/test/core/string/bytes.wren +++ b/test/core/string/bytes.wren @@ -3,4 +3,4 @@ // Chars: sø mé ஃ thî ng var s = "søméஃthîng" -IO.print(s.bytes is StringByteSequence) // expect: true +System.print(s.bytes is StringByteSequence) // expect: true diff --git a/test/core/string/concatenation.wren b/test/core/string/concatenation.wren index cbc696ac..e0da57dd 100644 --- a/test/core/string/concatenation.wren +++ b/test/core/string/concatenation.wren @@ -1,4 +1,4 @@ -IO.print("a" + "b") // expect: ab +System.print("a" + "b") // expect: ab // 8-bit clean. -IO.print(("a\0b" + "\0c") == "a\0b\0c") // expect: true +System.print(("a\0b" + "\0c") == "a\0b\0c") // expect: true diff --git a/test/core/string/concatenation_wrong_arg_type.wren b/test/core/string/concatenation_wrong_arg_type.wren index 38a5ea01..f7563659 100644 --- a/test/core/string/concatenation_wrong_arg_type.wren +++ b/test/core/string/concatenation_wrong_arg_type.wren @@ -1 +1 @@ -IO.print("a" + 123) // expect runtime error: Right operand must be a string. +System.print("a" + 123) // expect runtime error: Right operand must be a string. diff --git a/test/core/string/contains.wren b/test/core/string/contains.wren index 3151c5ef..b0514b86 100644 --- a/test/core/string/contains.wren +++ b/test/core/string/contains.wren @@ -1,16 +1,16 @@ -IO.print("".contains("")) // expect: true -IO.print("anything".contains("")) // expect: true -IO.print("something".contains("meth")) // expect: true -IO.print("something".contains("some")) // expect: true -IO.print("something".contains("ing")) // expect: true -IO.print("something".contains("math")) // expect: false +System.print("".contains("")) // expect: true +System.print("anything".contains("")) // expect: true +System.print("something".contains("meth")) // expect: true +System.print("something".contains("some")) // expect: true +System.print("something".contains("ing")) // expect: true +System.print("something".contains("math")) // expect: false // Non-ASCII. -IO.print("søméthîng".contains("méth")) // expect: true -IO.print("søméthîng".contains("meth")) // expect: false +System.print("søméthîng".contains("méth")) // expect: true +System.print("søméthîng".contains("meth")) // expect: false // 8-bit clean. -IO.print("a\0b\0c".contains("\0")) // expect: true -IO.print("a\0b\0c".contains("b")) // expect: true -IO.print("a\0b\0c".contains("b\0c")) // expect: true -IO.print("a\0b\0c".contains("bc")) // expect: false +System.print("a\0b\0c".contains("\0")) // expect: true +System.print("a\0b\0c".contains("b")) // expect: true +System.print("a\0b\0c".contains("b\0c")) // expect: true +System.print("a\0b\0c".contains("bc")) // expect: false diff --git a/test/core/string/count.wren b/test/core/string/count.wren index 3213d2d5..b06821b6 100644 --- a/test/core/string/count.wren +++ b/test/core/string/count.wren @@ -1,18 +1,18 @@ -IO.print("".count) // expect: 0 -IO.print("a string".count) // expect: 8 +System.print("".count) // expect: 0 +System.print("a string".count) // expect: 8 // 8-bit clean. -IO.print("\0".count) // expect: 1 -IO.print("a\0b".count) // expect: 3 -IO.print("\0c".count) // expect: 2 -IO.print(("a\0b" + "\0c").count) // expect: 5 +System.print("\0".count) // expect: 1 +System.print("a\0b".count) // expect: 3 +System.print("\0c".count) // expect: 2 +System.print(("a\0b" + "\0c").count) // expect: 5 // Treats a UTF-8 sequence as a single item. // // Bytes: 11111 // 012345678901234 // Chars: sø mé ஃ thî ng -IO.print("søméஃthîng".count) // expect: 10 +System.print("søméஃthîng".count) // expect: 10 // Counts invalid UTF-8 one byte at a time. -IO.print("\xefok\xf7".count) // expect: 4 +System.print("\xefok\xf7".count) // expect: 4 diff --git a/test/core/string/ends_with.wren b/test/core/string/ends_with.wren index 6fd81c29..9a2177f5 100644 --- a/test/core/string/ends_with.wren +++ b/test/core/string/ends_with.wren @@ -1,15 +1,15 @@ -IO.print("abcd".endsWith("cd")) // expect: true -IO.print("abcd".endsWith("abcde")) // expect: false -IO.print("abcd".endsWith("abcd")) // expect: true -IO.print("abcd".endsWith("f")) // expect: false -IO.print("abcd".endsWith("")) // expect: true +System.print("abcd".endsWith("cd")) // expect: true +System.print("abcd".endsWith("abcde")) // expect: false +System.print("abcd".endsWith("abcd")) // expect: true +System.print("abcd".endsWith("f")) // expect: false +System.print("abcd".endsWith("")) // expect: true // Non-ASCII. -IO.print("søméthîng".endsWith("thîng")) // expect: true -IO.print("søméthîng".endsWith("thing")) // expect: false +System.print("søméthîng".endsWith("thîng")) // expect: true +System.print("søméthîng".endsWith("thing")) // expect: false // 8-bit clean. -IO.print("a\0b\0c".endsWith("\0")) // expect: false -IO.print("a\0b\0c".endsWith("c")) // expect: true -IO.print("a\0b\0c".endsWith("\0c")) // expect: true -IO.print("a\0b\0c".endsWith("\0b")) // expect: false +System.print("a\0b\0c".endsWith("\0")) // expect: false +System.print("a\0b\0c".endsWith("c")) // expect: true +System.print("a\0b\0c".endsWith("\0c")) // expect: true +System.print("a\0b\0c".endsWith("\0b")) // expect: false diff --git a/test/core/string/ends_with_invalid_arg.wren b/test/core/string/ends_with_invalid_arg.wren index f7c75fd2..4b729e3b 100644 --- a/test/core/string/ends_with_invalid_arg.wren +++ b/test/core/string/ends_with_invalid_arg.wren @@ -1 +1 @@ -IO.print("abcd".endsWith(null)) // expect runtime error: Argument must be a string. \ No newline at end of file +System.print("abcd".endsWith(null)) // expect runtime error: Argument must be a string. \ No newline at end of file diff --git a/test/core/string/equality.wren b/test/core/string/equality.wren index 56ae4800..0715ea76 100644 --- a/test/core/string/equality.wren +++ b/test/core/string/equality.wren @@ -1,28 +1,28 @@ -IO.print("" == "") // expect: true -IO.print("abcd" == "abcd") // expect: true -IO.print("abcd" == "d") // expect: false -IO.print("e" == "abcd") // expect: false -IO.print("" == "abcd") // expect: false +System.print("" == "") // expect: true +System.print("abcd" == "abcd") // expect: true +System.print("abcd" == "d") // expect: false +System.print("e" == "abcd") // expect: false +System.print("" == "abcd") // expect: false // Not equal to other types. -IO.print("1" == 1) // expect: false -IO.print("true" == true) // expect: false +System.print("1" == 1) // expect: false +System.print("true" == true) // expect: false -IO.print("" != "") // expect: false -IO.print("abcd" != "abcd") // expect: false -IO.print("abcd" != "d") // expect: true -IO.print("e" != "abcd") // expect: true -IO.print("" != "abcd") // expect: true +System.print("" != "") // expect: false +System.print("abcd" != "abcd") // expect: false +System.print("abcd" != "d") // expect: true +System.print("e" != "abcd") // expect: true +System.print("" != "abcd") // expect: true // Not equal to other types. -IO.print("1" != 1) // expect: true -IO.print("true" != true) // expect: true +System.print("1" != 1) // expect: true +System.print("true" != true) // expect: true // Non-ASCII. -IO.print("vålue" == "value") // expect: false -IO.print("vålue" == "vålue") // expect: true +System.print("vålue" == "value") // expect: false +System.print("vålue" == "vålue") // expect: true // 8-bit clean. -IO.print("a\0b\0c" == "a") // expect: false -IO.print("a\0b\0c" == "abc") // expect: false -IO.print("a\0b\0c" == "a\0b\0c") // expect: true +System.print("a\0b\0c" == "a") // expect: false +System.print("a\0b\0c" == "abc") // expect: false +System.print("a\0b\0c" == "a\0b\0c") // expect: true diff --git a/test/core/string/from_code_point.wren b/test/core/string/from_code_point.wren index b61c8c73..5b9f8761 100644 --- a/test/core/string/from_code_point.wren +++ b/test/core/string/from_code_point.wren @@ -1,5 +1,5 @@ -IO.print(String.fromCodePoint(65)) // expect: A -IO.print(String.fromCodePoint(164)) // expect: ¤ -IO.print(String.fromCodePoint(398)) // expect: Ǝ -IO.print(String.fromCodePoint(8225)) // expect: ‡ -IO.print(String.fromCodePoint(0x254b)) // expect: ╋ +System.print(String.fromCodePoint(65)) // expect: A +System.print(String.fromCodePoint(164)) // expect: ¤ +System.print(String.fromCodePoint(398)) // expect: Ǝ +System.print(String.fromCodePoint(8225)) // expect: ‡ +System.print(String.fromCodePoint(0x254b)) // expect: ╋ diff --git a/test/core/string/from_code_point_not_int.wren b/test/core/string/from_code_point_not_int.wren index 8ee9e513..78c05201 100644 --- a/test/core/string/from_code_point_not_int.wren +++ b/test/core/string/from_code_point_not_int.wren @@ -1 +1 @@ -IO.print(String.fromCodePoint(12.34)) // expect runtime error: Code point must be an integer. +System.print(String.fromCodePoint(12.34)) // expect runtime error: Code point must be an integer. diff --git a/test/core/string/from_code_point_not_num.wren b/test/core/string/from_code_point_not_num.wren index 51daa10f..eaa386da 100644 --- a/test/core/string/from_code_point_not_num.wren +++ b/test/core/string/from_code_point_not_num.wren @@ -1 +1 @@ -IO.print(String.fromCodePoint("not num")) // expect runtime error: Code point must be a number. +System.print(String.fromCodePoint("not num")) // expect runtime error: Code point must be a number. diff --git a/test/core/string/from_code_point_too_large.wren b/test/core/string/from_code_point_too_large.wren index b213be62..9a9282c5 100644 --- a/test/core/string/from_code_point_too_large.wren +++ b/test/core/string/from_code_point_too_large.wren @@ -1,3 +1,3 @@ // UTF-8 mandates that only values up to 10ffff can be encoded. // See: http://tools.ietf.org/html/rfc3629 -IO.print(String.fromCodePoint(0x10ffff + 1)) // expect runtime error: Code point cannot be greater than 0x10ffff. +System.print(String.fromCodePoint(0x10ffff + 1)) // expect runtime error: Code point cannot be greater than 0x10ffff. diff --git a/test/core/string/from_code_point_too_small.wren b/test/core/string/from_code_point_too_small.wren index af4a08c6..5a5eee70 100644 --- a/test/core/string/from_code_point_too_small.wren +++ b/test/core/string/from_code_point_too_small.wren @@ -1 +1 @@ -IO.print(String.fromCodePoint(-1)) // expect runtime error: Code point cannot be negative. +System.print(String.fromCodePoint(-1)) // expect runtime error: Code point cannot be negative. diff --git a/test/core/string/index_of.wren b/test/core/string/index_of.wren index 18544278..22fb8f79 100644 --- a/test/core/string/index_of.wren +++ b/test/core/string/index_of.wren @@ -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 diff --git a/test/core/string/index_of_invalid_arg.wren b/test/core/string/index_of_invalid_arg.wren index 5d9393c5..d51c6af7 100644 --- a/test/core/string/index_of_invalid_arg.wren +++ b/test/core/string/index_of_invalid_arg.wren @@ -1 +1 @@ -IO.print("abcd".indexOf(null)) // expect runtime error: Argument must be a string. +System.print("abcd".indexOf(null)) // expect runtime error: Argument must be a string. diff --git a/test/core/string/iterate.wren b/test/core/string/iterate.wren index 6fd3ce3b..012db13b 100644 --- a/test/core/string/iterate.wren +++ b/test/core/string/iterate.wren @@ -1,29 +1,29 @@ var s = "abçd" -IO.print(s.iterate(null)) // expect: 0 -IO.print(s.iterate(0)) // expect: 1 -IO.print(s.iterate(1)) // expect: 2 +System.print(s.iterate(null)) // expect: 0 +System.print(s.iterate(0)) // expect: 1 +System.print(s.iterate(1)) // expect: 2 // Skip 3 because that's the middle of the ç sequence. -IO.print(s.iterate(2)) // expect: 4 +System.print(s.iterate(2)) // expect: 4 // Iterating from the middle of a UTF-8 sequence goes to the next one. -IO.print(s.iterate(3)) // expect: 4 -IO.print(s.iterate(4)) // expect: false +System.print(s.iterate(3)) // expect: 4 +System.print(s.iterate(4)) // expect: false // Out of bounds. -IO.print(s.iterate(123)) // expect: false -IO.print(s.iterate(-1)) // expect: false +System.print(s.iterate(123)) // expect: false +System.print(s.iterate(-1)) // expect: false // Nothing to iterate in an empty string. -IO.print("".iterate(null)) // expect: false +System.print("".iterate(null)) // expect: false // 8-bit clean. -IO.print("a\0b\0c".iterate(null)) // expect: 0 -IO.print("a\0b\0c".iterate(0)) // expect: 1 -IO.print("a\0b\0c".iterate(1)) // expect: 2 -IO.print("a\0b\0c".iterate(2)) // expect: 3 -IO.print("a\0b\0c".iterate(3)) // expect: 4 -IO.print("a\0b\0c".iterate(4)) // expect: false +System.print("a\0b\0c".iterate(null)) // expect: 0 +System.print("a\0b\0c".iterate(0)) // expect: 1 +System.print("a\0b\0c".iterate(1)) // expect: 2 +System.print("a\0b\0c".iterate(2)) // expect: 3 +System.print("a\0b\0c".iterate(3)) // expect: 4 +System.print("a\0b\0c".iterate(4)) // expect: false // Iterates over invalid UTF-8 one byte at a time. -IO.print("\xef\xf7".iterate(null)) // expect: 0 -IO.print("\xef\xf7".iterate(0)) // expect: 1 -IO.print("\xef\xf7".iterate(1)) // expect: false +System.print("\xef\xf7".iterate(null)) // expect: 0 +System.print("\xef\xf7".iterate(0)) // expect: 1 +System.print("\xef\xf7".iterate(1)) // expect: false diff --git a/test/core/string/iterator_value.wren b/test/core/string/iterator_value.wren index 85838310..7ae2669b 100644 --- a/test/core/string/iterator_value.wren +++ b/test/core/string/iterator_value.wren @@ -1,19 +1,19 @@ var s = "abçd" -IO.print(s.iteratorValue(0)) // expect: a -IO.print(s.iteratorValue(1)) // expect: b -IO.print(s.iteratorValue(2)) // expect: ç +System.print(s.iteratorValue(0)) // expect: a +System.print(s.iteratorValue(1)) // expect: b +System.print(s.iteratorValue(2)) // expect: ç // Iterator value in middle of UTF sequence is the unencoded byte. -IO.print(s.iteratorValue(3) == "\xa7") // expect: true -IO.print(s.iteratorValue(4)) // expect: d +System.print(s.iteratorValue(3) == "\xa7") // expect: true +System.print(s.iteratorValue(4)) // expect: d // 8-bit clean. var t = "a\0b\0c" -IO.print(t.iteratorValue(0) == "a") // expect: true -IO.print(t.iteratorValue(1) == "\0") // expect: true -IO.print(t.iteratorValue(2) == "b") // expect: true -IO.print(t.iteratorValue(3) == "\0") // expect: true -IO.print(t.iteratorValue(4) == "c") // expect: true +System.print(t.iteratorValue(0) == "a") // expect: true +System.print(t.iteratorValue(1) == "\0") // expect: true +System.print(t.iteratorValue(2) == "b") // expect: true +System.print(t.iteratorValue(3) == "\0") // expect: true +System.print(t.iteratorValue(4) == "c") // expect: true // Returns single byte strings for invalid UTF-8 sequences. -IO.print("\xef\xf7".iteratorValue(0) == "\xef") // expect: true -IO.print("\xef\xf7".iteratorValue(1) == "\xf7") // expect: true +System.print("\xef\xf7".iteratorValue(0) == "\xef") // expect: true +System.print("\xef\xf7".iteratorValue(1) == "\xf7") // expect: true diff --git a/test/core/string/join.wren b/test/core/string/join.wren index 19a8f215..7676cc41 100644 --- a/test/core/string/join.wren +++ b/test/core/string/join.wren @@ -1,10 +1,10 @@ var str = "string" -IO.print(str.join("") == str) // expect: true +System.print(str.join("") == str) // expect: true -IO.print(str.join(", ")) // expect: s, t, r, i, n, g +System.print(str.join(", ")) // expect: s, t, r, i, n, g // 8-bit clean. var ing = "a\0b\0c" -IO.print(ing.join("") == ing) // expect: true -IO.print(ing.join(", ") == "a, \0, b, \0, c") // expect: true +System.print(ing.join("") == ing) // expect: true +System.print(ing.join(", ") == "a, \0, b, \0, c") // expect: true diff --git a/test/core/string/not.wren b/test/core/string/not.wren index 03e48e15..889a666a 100644 --- a/test/core/string/not.wren +++ b/test/core/string/not.wren @@ -1,2 +1,2 @@ -IO.print(!"s") // expect: false -IO.print(!"") // expect: false +System.print(!"s") // expect: false +System.print(!"") // expect: false diff --git a/test/core/string/starts_with.wren b/test/core/string/starts_with.wren index 1b22e669..6d6944ac 100644 --- a/test/core/string/starts_with.wren +++ b/test/core/string/starts_with.wren @@ -1,14 +1,14 @@ -IO.print("abcd".startsWith("cd")) // expect: false -IO.print("abcd".startsWith("a")) // expect: true -IO.print("abcd".startsWith("abcd")) // expect: true -IO.print("abcd".startsWith("abcde")) // expect: false -IO.print("abcd".startsWith("")) // expect: true +System.print("abcd".startsWith("cd")) // expect: false +System.print("abcd".startsWith("a")) // expect: true +System.print("abcd".startsWith("abcd")) // expect: true +System.print("abcd".startsWith("abcde")) // expect: false +System.print("abcd".startsWith("")) // expect: true // Non-ASCII. -IO.print("søméthîng".startsWith("sømé")) // expect: true -IO.print("søméthîng".startsWith("some")) // expect: false +System.print("søméthîng".startsWith("sømé")) // expect: true +System.print("søméthîng".startsWith("some")) // expect: false // 8-bit clean. -IO.print("a\0b\0c".startsWith("a")) // expect: true -IO.print("a\0b\0c".startsWith("a\0")) // expect: true -IO.print("a\0b\0c".startsWith("b\0")) // expect: false +System.print("a\0b\0c".startsWith("a")) // expect: true +System.print("a\0b\0c".startsWith("a\0")) // expect: true +System.print("a\0b\0c".startsWith("b\0")) // expect: false diff --git a/test/core/string/starts_with_invalid_arg.wren b/test/core/string/starts_with_invalid_arg.wren index 7863aebc..7db1e71e 100644 --- a/test/core/string/starts_with_invalid_arg.wren +++ b/test/core/string/starts_with_invalid_arg.wren @@ -1 +1 @@ -IO.print("abcd".startsWith(null)) // expect runtime error: Argument must be a string. +System.print("abcd".startsWith(null)) // expect runtime error: Argument must be a string. diff --git a/test/core/string/subscript.wren b/test/core/string/subscript.wren index 97998efe..9c4dd5df 100644 --- a/test/core/string/subscript.wren +++ b/test/core/string/subscript.wren @@ -1,46 +1,46 @@ // Returns characters (as strings). -IO.print("abcd"[0]) // expect: a -IO.print("abcd"[1]) // expect: b -IO.print("abcd"[2]) // expect: c -IO.print("abcd"[3]) // expect: d +System.print("abcd"[0]) // expect: a +System.print("abcd"[1]) // expect: b +System.print("abcd"[2]) // expect: c +System.print("abcd"[3]) // expect: d // Allows indexing backwards from the end. -IO.print("abcd"[-4]) // expect: a -IO.print("abcd"[-3]) // expect: b -IO.print("abcd"[-2]) // expect: c -IO.print("abcd"[-1]) // expect: d +System.print("abcd"[-4]) // expect: a +System.print("abcd"[-3]) // expect: b +System.print("abcd"[-2]) // expect: c +System.print("abcd"[-1]) // expect: d // Regression: Make sure the string's internal buffer size is correct. -IO.print("abcd"[1] == "b") // expect: true +System.print("abcd"[1] == "b") // expect: true // Indexes by byte, not code point. // // Bytes: 11111 // 012345678901234 // Chars: sø mé ஃ thî ng -IO.print("søméஃthîng"[0]) // expect: s -IO.print("søméஃthîng"[1]) // expect: ø -IO.print("søméஃthîng"[3]) // expect: m -IO.print("søméஃthîng"[6]) // expect: ஃ -IO.print("søméஃthîng"[10]) // expect: h -IO.print("søméஃthîng"[-1]) // expect: g -IO.print("søméஃthîng"[-2]) // expect: n -IO.print("søméஃthîng"[-4]) // expect: î +System.print("søméஃthîng"[0]) // expect: s +System.print("søméஃthîng"[1]) // expect: ø +System.print("søméஃthîng"[3]) // expect: m +System.print("søméஃthîng"[6]) // expect: ஃ +System.print("søméஃthîng"[10]) // expect: h +System.print("søméஃthîng"[-1]) // expect: g +System.print("søméஃthîng"[-2]) // expect: n +System.print("søméஃthîng"[-4]) // expect: î // If the subscript is in the middle of a UTF-8 sequence, return the raw byte. -IO.print("søméஃthîng"[2] == "\xb8") // expect: true -IO.print("søméஃthîng"[7] == "\xae") // expect: true -IO.print("søméஃthîng"[8] == "\x83") // expect: true -IO.print("søméஃ"[-1] == "\x83") // expect: true -IO.print("søméஃ"[-2] == "\xae") // expect: true +System.print("søméஃthîng"[2] == "\xb8") // expect: true +System.print("søméஃthîng"[7] == "\xae") // expect: true +System.print("søméஃthîng"[8] == "\x83") // expect: true +System.print("søméஃ"[-1] == "\x83") // expect: true +System.print("søméஃ"[-2] == "\xae") // expect: true // 8-bit clean. -IO.print("a\0b\0c"[0] == "a") // expect: true -IO.print("a\0b\0c"[1] == "\0") // expect: true -IO.print("a\0b\0c"[2] == "b") // expect: true -IO.print("a\0b\0c"[3] == "\0") // expect: true -IO.print("a\0b\0c"[4] == "c") // expect: true +System.print("a\0b\0c"[0] == "a") // expect: true +System.print("a\0b\0c"[1] == "\0") // expect: true +System.print("a\0b\0c"[2] == "b") // expect: true +System.print("a\0b\0c"[3] == "\0") // expect: true +System.print("a\0b\0c"[4] == "c") // expect: true // Returns single byte strings for invalid UTF-8 sequences. -IO.print("\xef\xf7"[0] == "\xef") // expect: true -IO.print("\xef\xf7"[1] == "\xf7") // expect: true +System.print("\xef\xf7"[0] == "\xef") // expect: true +System.print("\xef\xf7"[1] == "\xf7") // expect: true diff --git a/test/core/string/subscript_range.wren b/test/core/string/subscript_range.wren index 75277e81..43ff4b34 100644 --- a/test/core/string/subscript_range.wren +++ b/test/core/string/subscript_range.wren @@ -1,49 +1,49 @@ var string = "abcde" -IO.print(string[0..0]) // expect: a -IO.print(string[1...1] == "") // expect: true -IO.print(string[1..2]) // expect: bc -IO.print(string[1...2]) // expect: b -IO.print(string[2..4]) // expect: cde -IO.print(string[2...5]) // expect: cde +System.print(string[0..0]) // expect: a +System.print(string[1...1] == "") // expect: true +System.print(string[1..2]) // expect: bc +System.print(string[1...2]) // expect: b +System.print(string[2..4]) // expect: cde +System.print(string[2...5]) // expect: cde // A backwards range reverses. -IO.print(string[3..1]) // expect: dcb -IO.print(string[3...1]) // expect: dc -IO.print(string[3...3] == "") // expect: true +System.print(string[3..1]) // expect: dcb +System.print(string[3...1]) // expect: dc +System.print(string[3...3] == "") // expect: true // Negative ranges index from the end. -IO.print(string[-5..-2]) // expect: abcd -IO.print(string[-5...-2]) // expect: abc -IO.print(string[-3..-5]) // expect: cba -IO.print(string[-3...-6]) // expect: cba +System.print(string[-5..-2]) // expect: abcd +System.print(string[-5...-2]) // expect: abc +System.print(string[-3..-5]) // expect: cba +System.print(string[-3...-6]) // expect: cba // Half-negative ranges are treated like the negative value is fixed before // walking the range. -IO.print(string[-5..3]) // expect: abcd -IO.print(string[-3...5]) // expect: cde -IO.print(string[-2..1]) // expect: dcb -IO.print(string[-2...0]) // expect: dcb +System.print(string[-5..3]) // expect: abcd +System.print(string[-3...5]) // expect: cde +System.print(string[-2..1]) // expect: dcb +System.print(string[-2...0]) // expect: dcb -IO.print(string[1..-2]) // expect: bcd -IO.print(string[2...-1]) // expect: cd -IO.print(string[4..-5]) // expect: edcba -IO.print(string[3...-6]) // expect: dcba +System.print(string[1..-2]) // expect: bcd +System.print(string[2...-1]) // expect: cd +System.print(string[4..-5]) // expect: edcba +System.print(string[3...-6]) // expect: dcba // An empty range at zero is allowed on an empty string. -IO.print(""[0...0] == "") // expect: true -IO.print(""[0..-1] == "") // expect: true +System.print(""[0...0] == "") // expect: true +System.print(""[0..-1] == "") // expect: true // Indexes by byte, not code point. // // Bytes: 11111 // 012345678901234 // Chars: sø mé ஃ thî ng -IO.print("søméஃthîng"[0..3]) // expect: søm -IO.print("søméஃthîng"[3...10]) // expect: méஃt +System.print("søméஃthîng"[0..3]) // expect: søm +System.print("søméஃthîng"[3...10]) // expect: méஃt // Only includes sequences whose first byte is in the range. -IO.print("søméஃthîng"[2..6]) // expect: méஃ -IO.print("søméஃthîng"[2...6]) // expect: mé -IO.print("søméஃthîng"[2...7]) // expect: méஃ +System.print("søméஃthîng"[2..6]) // expect: méஃ +System.print("søméஃthîng"[2...6]) // expect: mé +System.print("søméஃthîng"[2...7]) // expect: méஃ // TODO: Strings including invalid UTF-8. diff --git a/test/core/string/to_string.wren b/test/core/string/to_string.wren index 16d60d49..6fefb0e5 100644 --- a/test/core/string/to_string.wren +++ b/test/core/string/to_string.wren @@ -1,7 +1,7 @@ -IO.print("".toString == "") // expect: true -IO.print("blah".toString == "blah") // expect: true +System.print("".toString == "") // expect: true +System.print("blah".toString == "blah") // expect: true // 8-bit clean. -IO.print("a\0b\0c".toString == "a\0b\0c") // expect: true -IO.print("a\0b\0c".toString == "a") // expect: false -IO.print("a\0b\0c".toString) // expect: a +System.print("a\0b\0c".toString == "a\0b\0c") // expect: true +System.print("a\0b\0c".toString == "a") // expect: false +System.print("a\0b\0c".toString) // expect: a diff --git a/test/core/string/type.wren b/test/core/string/type.wren index 9af9bdf1..351333cd 100644 --- a/test/core/string/type.wren +++ b/test/core/string/type.wren @@ -1,4 +1,4 @@ -IO.print("s" is String) // expect: true -IO.print("s" is Object) // expect: true -IO.print("s" is Num) // expect: false -IO.print("s".type == String) // expect: true +System.print("s" is String) // expect: true +System.print("s" is Object) // expect: true +System.print("s" is Num) // expect: false +System.print("s".type == String) // expect: true diff --git a/test/core/string_byte_sequence/count.wren b/test/core/string_byte_sequence/count.wren index 822d0f98..fc7e862d 100644 --- a/test/core/string_byte_sequence/count.wren +++ b/test/core/string_byte_sequence/count.wren @@ -1,15 +1,15 @@ // Simple. -IO.print("".bytes.count) // expect: 0 -IO.print("123".bytes.count) // expect: 3 +System.print("".bytes.count) // expect: 0 +System.print("123".bytes.count) // expect: 3 // UTF-8. // Bytes: // 123456789 // Chars: sø mé ஃ -IO.print("søméஃ".bytes.count) // expect: 9 +System.print("søméஃ".bytes.count) // expect: 9 // Null bytes. -IO.print("\0\0\0".bytes.count) // expect: 3 +System.print("\0\0\0".bytes.count) // expect: 3 // Invalid UTF-8. -IO.print("\xef\xf7".bytes.count) // expect: 2 +System.print("\xef\xf7".bytes.count) // expect: 2 diff --git a/test/core/string_byte_sequence/iterate.wren b/test/core/string_byte_sequence/iterate.wren index 650a61d4..b784cfdb 100644 --- a/test/core/string_byte_sequence/iterate.wren +++ b/test/core/string_byte_sequence/iterate.wren @@ -3,19 +3,19 @@ // Chars: sø mé ஃ var bytes = "søméஃ".bytes -IO.print(bytes.iterate(null)) // expect: 0 -IO.print("".bytes.iterate(null)) // expect: false +System.print(bytes.iterate(null)) // expect: 0 +System.print("".bytes.iterate(null)) // expect: false -IO.print(bytes.iterate(0)) // expect: 1 -IO.print(bytes.iterate(1)) // expect: 2 -IO.print(bytes.iterate(2)) // expect: 3 -IO.print(bytes.iterate(3)) // expect: 4 -IO.print(bytes.iterate(4)) // expect: 5 -IO.print(bytes.iterate(5)) // expect: 6 -IO.print(bytes.iterate(6)) // expect: 7 -IO.print(bytes.iterate(7)) // expect: 8 -IO.print(bytes.iterate(8)) // expect: false +System.print(bytes.iterate(0)) // expect: 1 +System.print(bytes.iterate(1)) // expect: 2 +System.print(bytes.iterate(2)) // expect: 3 +System.print(bytes.iterate(3)) // expect: 4 +System.print(bytes.iterate(4)) // expect: 5 +System.print(bytes.iterate(5)) // expect: 6 +System.print(bytes.iterate(6)) // expect: 7 +System.print(bytes.iterate(7)) // expect: 8 +System.print(bytes.iterate(8)) // expect: false // Out of bounds. -IO.print(bytes.iterate(123)) // expect: false -IO.print(bytes.iterate(-1)) // expect: false +System.print(bytes.iterate(123)) // expect: false +System.print(bytes.iterate(-1)) // expect: false diff --git a/test/core/string_byte_sequence/iterator_value.wren b/test/core/string_byte_sequence/iterator_value.wren index 544d3869..329589ae 100644 --- a/test/core/string_byte_sequence/iterator_value.wren +++ b/test/core/string_byte_sequence/iterator_value.wren @@ -3,22 +3,22 @@ // Chars: sø mé ஃ var bytes = "søméஃ".bytes -IO.print(bytes.iteratorValue(0)) // expect: 115 -IO.print(bytes.iteratorValue(1)) // expect: 195 -IO.print(bytes.iteratorValue(2)) // expect: 184 -IO.print(bytes.iteratorValue(3)) // expect: 109 -IO.print(bytes.iteratorValue(4)) // expect: 195 -IO.print(bytes.iteratorValue(5)) // expect: 169 -IO.print(bytes.iteratorValue(6)) // expect: 224 -IO.print(bytes.iteratorValue(7)) // expect: 174 -IO.print(bytes.iteratorValue(8)) // expect: 131 +System.print(bytes.iteratorValue(0)) // expect: 115 +System.print(bytes.iteratorValue(1)) // expect: 195 +System.print(bytes.iteratorValue(2)) // expect: 184 +System.print(bytes.iteratorValue(3)) // expect: 109 +System.print(bytes.iteratorValue(4)) // expect: 195 +System.print(bytes.iteratorValue(5)) // expect: 169 +System.print(bytes.iteratorValue(6)) // expect: 224 +System.print(bytes.iteratorValue(7)) // expect: 174 +System.print(bytes.iteratorValue(8)) // expect: 131 -IO.print(bytes.iteratorValue(-9)) // expect: 115 -IO.print(bytes.iteratorValue(-8)) // expect: 195 -IO.print(bytes.iteratorValue(-7)) // expect: 184 -IO.print(bytes.iteratorValue(-6)) // expect: 109 -IO.print(bytes.iteratorValue(-5)) // expect: 195 -IO.print(bytes.iteratorValue(-4)) // expect: 169 -IO.print(bytes.iteratorValue(-3)) // expect: 224 -IO.print(bytes.iteratorValue(-2)) // expect: 174 -IO.print(bytes.iteratorValue(-1)) // expect: 131 +System.print(bytes.iteratorValue(-9)) // expect: 115 +System.print(bytes.iteratorValue(-8)) // expect: 195 +System.print(bytes.iteratorValue(-7)) // expect: 184 +System.print(bytes.iteratorValue(-6)) // expect: 109 +System.print(bytes.iteratorValue(-5)) // expect: 195 +System.print(bytes.iteratorValue(-4)) // expect: 169 +System.print(bytes.iteratorValue(-3)) // expect: 224 +System.print(bytes.iteratorValue(-2)) // expect: 174 +System.print(bytes.iteratorValue(-1)) // expect: 131 diff --git a/test/core/string_byte_sequence/subscript.wren b/test/core/string_byte_sequence/subscript.wren index 0e073978..17131581 100644 --- a/test/core/string_byte_sequence/subscript.wren +++ b/test/core/string_byte_sequence/subscript.wren @@ -3,22 +3,22 @@ // Chars: sø mé ஃ var bytes = "søméஃ".bytes -IO.print(bytes[0]) // expect: 115 -IO.print(bytes[1]) // expect: 195 -IO.print(bytes[2]) // expect: 184 -IO.print(bytes[3]) // expect: 109 -IO.print(bytes[4]) // expect: 195 -IO.print(bytes[5]) // expect: 169 -IO.print(bytes[6]) // expect: 224 -IO.print(bytes[7]) // expect: 174 -IO.print(bytes[8]) // expect: 131 +System.print(bytes[0]) // expect: 115 +System.print(bytes[1]) // expect: 195 +System.print(bytes[2]) // expect: 184 +System.print(bytes[3]) // expect: 109 +System.print(bytes[4]) // expect: 195 +System.print(bytes[5]) // expect: 169 +System.print(bytes[6]) // expect: 224 +System.print(bytes[7]) // expect: 174 +System.print(bytes[8]) // expect: 131 -IO.print(bytes[-9]) // expect: 115 -IO.print(bytes[-8]) // expect: 195 -IO.print(bytes[-7]) // expect: 184 -IO.print(bytes[-6]) // expect: 109 -IO.print(bytes[-5]) // expect: 195 -IO.print(bytes[-4]) // expect: 169 -IO.print(bytes[-3]) // expect: 224 -IO.print(bytes[-2]) // expect: 174 -IO.print(bytes[-1]) // expect: 131 +System.print(bytes[-9]) // expect: 115 +System.print(bytes[-8]) // expect: 195 +System.print(bytes[-7]) // expect: 184 +System.print(bytes[-6]) // expect: 109 +System.print(bytes[-5]) // expect: 195 +System.print(bytes[-4]) // expect: 169 +System.print(bytes[-3]) // expect: 224 +System.print(bytes[-2]) // expect: 174 +System.print(bytes[-1]) // expect: 131 diff --git a/test/core/string_code_point_sequence/count.wren b/test/core/string_code_point_sequence/count.wren index 4b9c87e3..e90e8b25 100644 --- a/test/core/string_code_point_sequence/count.wren +++ b/test/core/string_code_point_sequence/count.wren @@ -1,18 +1,18 @@ -IO.print("".codePoints.count) // expect: 0 -IO.print("a string".codePoints.count) // expect: 8 +System.print("".codePoints.count) // expect: 0 +System.print("a string".codePoints.count) // expect: 8 // 8-bit clean. -IO.print("\0".codePoints.count) // expect: 1 -IO.print("a\0b".codePoints.count) // expect: 3 -IO.print("\0c".codePoints.count) // expect: 2 -IO.print(("a\0b" + "\0c").codePoints.count) // expect: 5 +System.print("\0".codePoints.count) // expect: 1 +System.print("a\0b".codePoints.count) // expect: 3 +System.print("\0c".codePoints.count) // expect: 2 +System.print(("a\0b" + "\0c").codePoints.count) // expect: 5 // Treats a UTF-8 sequence as a single item. // // Bytes: 11111 // 012345678901234 // Chars: sø mé ஃ thî ng -IO.print("søméஃthîng".codePoints.count) // expect: 10 +System.print("søméஃthîng".codePoints.count) // expect: 10 // Counts invalid UTF-8 one byte at a time. -IO.print("\xefok\xf7".codePoints.count) // expect: 4 +System.print("\xefok\xf7".codePoints.count) // expect: 4 diff --git a/test/core/string_code_point_sequence/iterate.wren b/test/core/string_code_point_sequence/iterate.wren index f29db020..fd2eb307 100644 --- a/test/core/string_code_point_sequence/iterate.wren +++ b/test/core/string_code_point_sequence/iterate.wren @@ -1,29 +1,29 @@ var codePoints = "abçd".codePoints -IO.print(codePoints.iterate(null)) // expect: 0 -IO.print(codePoints.iterate(0)) // expect: 1 -IO.print(codePoints.iterate(1)) // expect: 2 +System.print(codePoints.iterate(null)) // expect: 0 +System.print(codePoints.iterate(0)) // expect: 1 +System.print(codePoints.iterate(1)) // expect: 2 // Skip 3 because that's the middle of the ç sequence. -IO.print(codePoints.iterate(2)) // expect: 4 +System.print(codePoints.iterate(2)) // expect: 4 // Iterating from the middle of a UTF-8 sequence goes to the next one. -IO.print(codePoints.iterate(3)) // expect: 4 -IO.print(codePoints.iterate(4)) // expect: false +System.print(codePoints.iterate(3)) // expect: 4 +System.print(codePoints.iterate(4)) // expect: false // Out of bounds. -IO.print(codePoints.iterate(123)) // expect: false -IO.print(codePoints.iterate(-1)) // expect: false +System.print(codePoints.iterate(123)) // expect: false +System.print(codePoints.iterate(-1)) // expect: false // Nothing to iterate in an empty string. -IO.print("".codePoints.iterate(null)) // expect: false +System.print("".codePoints.iterate(null)) // expect: false // 8-bit clean. -IO.print("a\0b\0c".codePoints.iterate(null)) // expect: 0 -IO.print("a\0b\0c".codePoints.iterate(0)) // expect: 1 -IO.print("a\0b\0c".codePoints.iterate(1)) // expect: 2 -IO.print("a\0b\0c".codePoints.iterate(2)) // expect: 3 -IO.print("a\0b\0c".codePoints.iterate(3)) // expect: 4 -IO.print("a\0b\0c".codePoints.iterate(4)) // expect: false +System.print("a\0b\0c".codePoints.iterate(null)) // expect: 0 +System.print("a\0b\0c".codePoints.iterate(0)) // expect: 1 +System.print("a\0b\0c".codePoints.iterate(1)) // expect: 2 +System.print("a\0b\0c".codePoints.iterate(2)) // expect: 3 +System.print("a\0b\0c".codePoints.iterate(3)) // expect: 4 +System.print("a\0b\0c".codePoints.iterate(4)) // expect: false // Iterates over invalid UTF-8 one byte at a time. -IO.print("\xef\xf7".codePoints.iterate(null)) // expect: 0 -IO.print("\xef\xf7".codePoints.iterate(0)) // expect: 1 -IO.print("\xef\xf7".codePoints.iterate(1)) // expect: false +System.print("\xef\xf7".codePoints.iterate(null)) // expect: 0 +System.print("\xef\xf7".codePoints.iterate(0)) // expect: 1 +System.print("\xef\xf7".codePoints.iterate(1)) // expect: false diff --git a/test/core/string_code_point_sequence/iterator_value.wren b/test/core/string_code_point_sequence/iterator_value.wren index 54af5f1b..46a6d925 100644 --- a/test/core/string_code_point_sequence/iterator_value.wren +++ b/test/core/string_code_point_sequence/iterator_value.wren @@ -3,40 +3,40 @@ // Chars: sø mé ஃ thî ng var codePoints = "søméஃthîng".codePoints -IO.print(codePoints.iteratorValue(0)) // expect: 115 -IO.print(codePoints.iteratorValue(1)) // expect: 248 -IO.print(codePoints.iteratorValue(2)) // expect: -1 -IO.print(codePoints.iteratorValue(3)) // expect: 109 -IO.print(codePoints.iteratorValue(4)) // expect: 233 -IO.print(codePoints.iteratorValue(5)) // expect: -1 -IO.print(codePoints.iteratorValue(6)) // expect: 2947 -IO.print(codePoints.iteratorValue(7)) // expect: -1 -IO.print(codePoints.iteratorValue(8)) // expect: -1 -IO.print(codePoints.iteratorValue(9)) // expect: 116 -IO.print(codePoints.iteratorValue(10)) // expect: 104 -IO.print(codePoints.iteratorValue(11)) // expect: 238 -IO.print(codePoints.iteratorValue(12)) // expect: -1 -IO.print(codePoints.iteratorValue(13)) // expect: 110 -IO.print(codePoints.iteratorValue(14)) // expect: 103 +System.print(codePoints.iteratorValue(0)) // expect: 115 +System.print(codePoints.iteratorValue(1)) // expect: 248 +System.print(codePoints.iteratorValue(2)) // expect: -1 +System.print(codePoints.iteratorValue(3)) // expect: 109 +System.print(codePoints.iteratorValue(4)) // expect: 233 +System.print(codePoints.iteratorValue(5)) // expect: -1 +System.print(codePoints.iteratorValue(6)) // expect: 2947 +System.print(codePoints.iteratorValue(7)) // expect: -1 +System.print(codePoints.iteratorValue(8)) // expect: -1 +System.print(codePoints.iteratorValue(9)) // expect: 116 +System.print(codePoints.iteratorValue(10)) // expect: 104 +System.print(codePoints.iteratorValue(11)) // expect: 238 +System.print(codePoints.iteratorValue(12)) // expect: -1 +System.print(codePoints.iteratorValue(13)) // expect: 110 +System.print(codePoints.iteratorValue(14)) // expect: 103 -IO.print(codePoints.iteratorValue(-15)) // expect: 115 -IO.print(codePoints.iteratorValue(-14)) // expect: 248 -IO.print(codePoints.iteratorValue(-13)) // expect: -1 -IO.print(codePoints.iteratorValue(-12)) // expect: 109 -IO.print(codePoints.iteratorValue(-11)) // expect: 233 -IO.print(codePoints.iteratorValue(-10)) // expect: -1 -IO.print(codePoints.iteratorValue(-9)) // expect: 2947 -IO.print(codePoints.iteratorValue(-8)) // expect: -1 -IO.print(codePoints.iteratorValue(-7)) // expect: -1 -IO.print(codePoints.iteratorValue(-6)) // expect: 116 -IO.print(codePoints.iteratorValue(-5)) // expect: 104 -IO.print(codePoints.iteratorValue(-4)) // expect: 238 -IO.print(codePoints.iteratorValue(-3)) // expect: -1 -IO.print(codePoints.iteratorValue(-2)) // expect: 110 -IO.print(codePoints.iteratorValue(-1)) // expect: 103 +System.print(codePoints.iteratorValue(-15)) // expect: 115 +System.print(codePoints.iteratorValue(-14)) // expect: 248 +System.print(codePoints.iteratorValue(-13)) // expect: -1 +System.print(codePoints.iteratorValue(-12)) // expect: 109 +System.print(codePoints.iteratorValue(-11)) // expect: 233 +System.print(codePoints.iteratorValue(-10)) // expect: -1 +System.print(codePoints.iteratorValue(-9)) // expect: 2947 +System.print(codePoints.iteratorValue(-8)) // expect: -1 +System.print(codePoints.iteratorValue(-7)) // expect: -1 +System.print(codePoints.iteratorValue(-6)) // expect: 116 +System.print(codePoints.iteratorValue(-5)) // expect: 104 +System.print(codePoints.iteratorValue(-4)) // expect: 238 +System.print(codePoints.iteratorValue(-3)) // expect: -1 +System.print(codePoints.iteratorValue(-2)) // expect: 110 +System.print(codePoints.iteratorValue(-1)) // expect: 103 -IO.print("\0".codePoints.iteratorValue(0)) // expect: 0 +System.print("\0".codePoints.iteratorValue(0)) // expect: 0 // Returns -1 for invalid UTF-8 sequences. -IO.print("\xef\xf7".codePoints.iteratorValue(0)) // expect: -1 -IO.print("\xef\xf7".codePoints.iteratorValue(1)) // expect: -1 +System.print("\xef\xf7".codePoints.iteratorValue(0)) // expect: -1 +System.print("\xef\xf7".codePoints.iteratorValue(1)) // expect: -1 diff --git a/test/core/string_code_point_sequence/iterator_value_incomplete.wren b/test/core/string_code_point_sequence/iterator_value_incomplete.wren index ebc59184..fcdab1f9 100644 --- a/test/core/string_code_point_sequence/iterator_value_incomplete.wren +++ b/test/core/string_code_point_sequence/iterator_value_incomplete.wren @@ -1,8 +1,8 @@ // The first byte of a two-octet sequence. -IO.print("\xc0".codePoints.iteratorValue(0)) // expect: -1 +System.print("\xc0".codePoints.iteratorValue(0)) // expect: -1 // The first byte of a three-octet sequence. -IO.print("\xe0".codePoints.iteratorValue(0)) // expect: -1 +System.print("\xe0".codePoints.iteratorValue(0)) // expect: -1 // The first two bytes of a three-octet sequence. -IO.print("\xe0\xae".codePoints.iteratorValue(0)) // expect: -1 +System.print("\xe0\xae".codePoints.iteratorValue(0)) // expect: -1 diff --git a/test/core/string_code_point_sequence/iterator_value_not_int.wren b/test/core/string_code_point_sequence/iterator_value_not_int.wren index 0f4ed51b..eed2fd92 100644 --- a/test/core/string_code_point_sequence/iterator_value_not_int.wren +++ b/test/core/string_code_point_sequence/iterator_value_not_int.wren @@ -1 +1 @@ -IO.print("string".codePoints.iteratorValue(12.34)) // expect runtime error: Index must be an integer. +System.print("string".codePoints.iteratorValue(12.34)) // expect runtime error: Index must be an integer. diff --git a/test/core/string_code_point_sequence/iterator_value_not_num.wren b/test/core/string_code_point_sequence/iterator_value_not_num.wren index f0c9d4fb..8fcb3c16 100644 --- a/test/core/string_code_point_sequence/iterator_value_not_num.wren +++ b/test/core/string_code_point_sequence/iterator_value_not_num.wren @@ -1 +1 @@ -IO.print("string".codePoints.iteratorValue("not num")) // expect runtime error: Index must be a number. +System.print("string".codePoints.iteratorValue("not num")) // expect runtime error: Index must be a number. diff --git a/test/core/string_code_point_sequence/iterator_value_too_large.wren b/test/core/string_code_point_sequence/iterator_value_too_large.wren index 8e8598c4..67c73703 100644 --- a/test/core/string_code_point_sequence/iterator_value_too_large.wren +++ b/test/core/string_code_point_sequence/iterator_value_too_large.wren @@ -1 +1 @@ -IO.print("string".codePoints.iteratorValue(6)) // expect runtime error: Index out of bounds. +System.print("string".codePoints.iteratorValue(6)) // expect runtime error: Index out of bounds. diff --git a/test/core/string_code_point_sequence/iterator_value_too_small.wren b/test/core/string_code_point_sequence/iterator_value_too_small.wren index 2fd95fa9..07c9ebf8 100644 --- a/test/core/string_code_point_sequence/iterator_value_too_small.wren +++ b/test/core/string_code_point_sequence/iterator_value_too_small.wren @@ -1 +1 @@ -IO.print("string".codePoints.iteratorValue(-7)) // expect runtime error: Index out of bounds. +System.print("string".codePoints.iteratorValue(-7)) // expect runtime error: Index out of bounds. diff --git a/test/core/string_code_point_sequence/subscript.wren b/test/core/string_code_point_sequence/subscript.wren index 3e250bcf..8db638df 100644 --- a/test/core/string_code_point_sequence/subscript.wren +++ b/test/core/string_code_point_sequence/subscript.wren @@ -3,40 +3,40 @@ // Chars: sø mé ஃ thî ng var codePoints = "søméஃthîng".codePoints -IO.print(codePoints[0]) // expect: 115 -IO.print(codePoints[1]) // expect: 248 -IO.print(codePoints[2]) // expect: -1 -IO.print(codePoints[3]) // expect: 109 -IO.print(codePoints[4]) // expect: 233 -IO.print(codePoints[5]) // expect: -1 -IO.print(codePoints[6]) // expect: 2947 -IO.print(codePoints[7]) // expect: -1 -IO.print(codePoints[8]) // expect: -1 -IO.print(codePoints[9]) // expect: 116 -IO.print(codePoints[10]) // expect: 104 -IO.print(codePoints[11]) // expect: 238 -IO.print(codePoints[12]) // expect: -1 -IO.print(codePoints[13]) // expect: 110 -IO.print(codePoints[14]) // expect: 103 +System.print(codePoints[0]) // expect: 115 +System.print(codePoints[1]) // expect: 248 +System.print(codePoints[2]) // expect: -1 +System.print(codePoints[3]) // expect: 109 +System.print(codePoints[4]) // expect: 233 +System.print(codePoints[5]) // expect: -1 +System.print(codePoints[6]) // expect: 2947 +System.print(codePoints[7]) // expect: -1 +System.print(codePoints[8]) // expect: -1 +System.print(codePoints[9]) // expect: 116 +System.print(codePoints[10]) // expect: 104 +System.print(codePoints[11]) // expect: 238 +System.print(codePoints[12]) // expect: -1 +System.print(codePoints[13]) // expect: 110 +System.print(codePoints[14]) // expect: 103 -IO.print(codePoints[-15]) // expect: 115 -IO.print(codePoints[-14]) // expect: 248 -IO.print(codePoints[-13]) // expect: -1 -IO.print(codePoints[-12]) // expect: 109 -IO.print(codePoints[-11]) // expect: 233 -IO.print(codePoints[-10]) // expect: -1 -IO.print(codePoints[-9]) // expect: 2947 -IO.print(codePoints[-8]) // expect: -1 -IO.print(codePoints[-7]) // expect: -1 -IO.print(codePoints[-6]) // expect: 116 -IO.print(codePoints[-5]) // expect: 104 -IO.print(codePoints[-4]) // expect: 238 -IO.print(codePoints[-3]) // expect: -1 -IO.print(codePoints[-2]) // expect: 110 -IO.print(codePoints[-1]) // expect: 103 +System.print(codePoints[-15]) // expect: 115 +System.print(codePoints[-14]) // expect: 248 +System.print(codePoints[-13]) // expect: -1 +System.print(codePoints[-12]) // expect: 109 +System.print(codePoints[-11]) // expect: 233 +System.print(codePoints[-10]) // expect: -1 +System.print(codePoints[-9]) // expect: 2947 +System.print(codePoints[-8]) // expect: -1 +System.print(codePoints[-7]) // expect: -1 +System.print(codePoints[-6]) // expect: 116 +System.print(codePoints[-5]) // expect: 104 +System.print(codePoints[-4]) // expect: 238 +System.print(codePoints[-3]) // expect: -1 +System.print(codePoints[-2]) // expect: 110 +System.print(codePoints[-1]) // expect: 103 -IO.print("\0".codePoints[0]) // expect: 0 +System.print("\0".codePoints[0]) // expect: 0 // Returns -1 for invalid UTF-8 sequences. -IO.print("\xef\xf7".codePoints[0]) // expect: -1 -IO.print("\xef\xf7".codePoints[1]) // expect: -1 +System.print("\xef\xf7".codePoints[0]) // expect: -1 +System.print("\xef\xf7".codePoints[1]) // expect: -1 diff --git a/test/core/string_code_point_sequence/subscript_incomplete.wren b/test/core/string_code_point_sequence/subscript_incomplete.wren index 2a280213..ca48400f 100644 --- a/test/core/string_code_point_sequence/subscript_incomplete.wren +++ b/test/core/string_code_point_sequence/subscript_incomplete.wren @@ -1,8 +1,8 @@ // The first byte of a two-octet sequence. -IO.print("\xc0".codePoints[0]) // expect: -1 +System.print("\xc0".codePoints[0]) // expect: -1 // The first byte of a three-octet sequence. -IO.print("\xe0".codePoints[0]) // expect: -1 +System.print("\xe0".codePoints[0]) // expect: -1 // The first two bytes of a three-octet sequence. -IO.print("\xe0\xae".codePoints[0]) // expect: -1 +System.print("\xe0\xae".codePoints[0]) // expect: -1 diff --git a/test/core/string_code_point_sequence/subscript_not_int.wren b/test/core/string_code_point_sequence/subscript_not_int.wren index acc7d5bc..2ed30a1c 100644 --- a/test/core/string_code_point_sequence/subscript_not_int.wren +++ b/test/core/string_code_point_sequence/subscript_not_int.wren @@ -1 +1 @@ -IO.print("string".codePoints[12.34]) // expect runtime error: Index must be an integer. +System.print("string".codePoints[12.34]) // expect runtime error: Index must be an integer. diff --git a/test/core/string_code_point_sequence/subscript_not_num.wren b/test/core/string_code_point_sequence/subscript_not_num.wren index 07dcf851..069686c4 100644 --- a/test/core/string_code_point_sequence/subscript_not_num.wren +++ b/test/core/string_code_point_sequence/subscript_not_num.wren @@ -1 +1 @@ -IO.print("string".codePoints["not num"]) // expect runtime error: Index must be a number. +System.print("string".codePoints["not num"]) // expect runtime error: Index must be a number. diff --git a/test/core/string_code_point_sequence/subscript_too_large.wren b/test/core/string_code_point_sequence/subscript_too_large.wren index fb40d9d7..f5681d7c 100644 --- a/test/core/string_code_point_sequence/subscript_too_large.wren +++ b/test/core/string_code_point_sequence/subscript_too_large.wren @@ -1 +1 @@ -IO.print("string".codePoints[6]) // expect runtime error: Index out of bounds. +System.print("string".codePoints[6]) // expect runtime error: Index out of bounds. diff --git a/test/core/string_code_point_sequence/subscript_too_small.wren b/test/core/string_code_point_sequence/subscript_too_small.wren index 5928ce7d..1cf42cd3 100644 --- a/test/core/string_code_point_sequence/subscript_too_small.wren +++ b/test/core/string_code_point_sequence/subscript_too_small.wren @@ -1 +1 @@ -IO.print("string".codePoints[-7]) // expect runtime error: Index out of bounds. +System.print("string".codePoints[-7]) // expect runtime error: Index out of bounds. diff --git a/test/core/system/print.wren b/test/core/system/print.wren new file mode 100644 index 00000000..60d4df3c --- /dev/null +++ b/test/core/system/print.wren @@ -0,0 +1,12 @@ +class Foo { + construct new() {} + + toString { "Foo.toString" } +} + +// Calls toString on argument. +System.print(Foo.new()) // expect: Foo.toString + +// Returns the argument. +System.print(System.print(1) == 1) // expect: 1 + // expect: true diff --git a/test/core/system/print_all.wren b/test/core/system/print_all.wren new file mode 100644 index 00000000..202524bd --- /dev/null +++ b/test/core/system/print_all.wren @@ -0,0 +1,8 @@ +class Foo { + construct new() {} + + toString { "Foo" } +} + +System.printAll([]) // expect: +System.printAll([1, true, Foo.new(), "s"]) // expect: 1trueFoos diff --git a/test/core/system/print_all_not_sequence.wren b/test/core/system/print_all_not_sequence.wren new file mode 100644 index 00000000..f47831aa --- /dev/null +++ b/test/core/system/print_all_not_sequence.wren @@ -0,0 +1 @@ +System.printAll(123) // expect runtime error: Num does not implement 'iterate(_)'. diff --git a/test/core/system/print_bad_to_string.wren b/test/core/system/print_bad_to_string.wren new file mode 100644 index 00000000..fdae6e71 --- /dev/null +++ b/test/core/system/print_bad_to_string.wren @@ -0,0 +1,6 @@ +class BadToString { + construct new() {} + toString { 3 } +} + +System.print(BadToString.new()) // expect: [invalid toString] diff --git a/test/core/system/write_all.wren b/test/core/system/write_all.wren new file mode 100644 index 00000000..8bca90dd --- /dev/null +++ b/test/core/system/write_all.wren @@ -0,0 +1,10 @@ +class Foo { + construct new() {} + + toString { "Foo" } +} + +System.writeAll([]) // expect: +System.print() +System.writeAll([1, true, Foo.new(), "s"]) // expect: 1trueFoos +System.print() diff --git a/test/core/system/write_all_not_sequence.wren b/test/core/system/write_all_not_sequence.wren new file mode 100644 index 00000000..3d158977 --- /dev/null +++ b/test/core/system/write_all_not_sequence.wren @@ -0,0 +1 @@ +System.writeAll(123) // expect runtime error: Num does not implement 'iterate(_)'. diff --git a/test/core/system/write_bad_to_string.wren b/test/core/system/write_bad_to_string.wren new file mode 100644 index 00000000..bb0a1a1b --- /dev/null +++ b/test/core/system/write_bad_to_string.wren @@ -0,0 +1,7 @@ +class BadToString { + construct new() {} + toString { 3 } +} + +System.write(BadToString.new()) +System.print("!") // expect: [invalid toString]! diff --git a/test/io/print.wren b/test/io/print.wren deleted file mode 100644 index c02647d8..00000000 --- a/test/io/print.wren +++ /dev/null @@ -1,34 +0,0 @@ -class Foo { - construct new() {} - - toString { "Foo.toString" } -} - -// Calls toString on argument. -IO.print(Foo.new()) // expect: Foo.toString - -// With one argument, returns the argument. -IO.print(IO.print(1) == 1) // expect: 1 - // expect: true - -// With more than one argument, returns null. -IO.print(IO.print(1, 2) == null) // expect: 12 - // expect: true - -// Allows multiple arguments and concatenates them. -IO.print(1) // expect: 1 -IO.print(1, 2) // expect: 12 -IO.print(1, 2, 3) // expect: 123 -IO.print(1, 2, 3, 4) // expect: 1234 -IO.print(1, 2, 3, 4, 5) // expect: 12345 -IO.print(1, 2, 3, 4, 5, 6) // expect: 123456 -IO.print(1, 2, 3, 4, 5, 6, 7) // expect: 1234567 -IO.print(1, 2, 3, 4, 5, 6, 7, 8) // expect: 12345678 -IO.print(1, 2, 3, 4, 5, 6, 7, 8, 9) // expect: 123456789 -IO.print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) // expect: 12345678910 -IO.print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) // expect: 1234567891011 -IO.print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) // expect: 123456789101112 -IO.print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13) // expect: 12345678910111213 -IO.print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14) // expect: 1234567891011121314 -IO.print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) // expect: 123456789101112131415 -IO.print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) // expect: 12345678910111213141516 diff --git a/test/io/print_bad_to_string.wren b/test/io/print_bad_to_string.wren deleted file mode 100644 index af750175..00000000 --- a/test/io/print_bad_to_string.wren +++ /dev/null @@ -1,6 +0,0 @@ -class BadToString { - construct new() {} - toString { 3 } -} - -IO.print(BadToString.new()) // expect: [invalid toString] diff --git a/test/io/read.wren b/test/io/read.wren deleted file mode 100644 index 0b542f6e..00000000 --- a/test/io/read.wren +++ /dev/null @@ -1,13 +0,0 @@ -var a = IO.read("a:") // stdin: first -var b = IO.read("b:") // stdin: second -IO.print -// Using write() here because the read lines include the trailing newline. -IO.write(a) -IO.write(b) - -// Since stdin isn't echoed back to stdout, we don't see the input lines here, -// and there is no newline between the two prompts since that normally comes -// from the input itself. -// expect: a:b: -// expect: first -// expect: second \ No newline at end of file diff --git a/test/io/read_arg_not_string.wren b/test/io/read_arg_not_string.wren deleted file mode 100644 index 85a23892..00000000 --- a/test/io/read_arg_not_string.wren +++ /dev/null @@ -1 +0,0 @@ -IO.read(null) // expect runtime error: Prompt must be a string. diff --git a/test/io/read_eof.wren b/test/io/read_eof.wren deleted file mode 100644 index db9045aa..00000000 --- a/test/io/read_eof.wren +++ /dev/null @@ -1 +0,0 @@ -IO.write(IO.read()) // expect: null diff --git a/test/io/write_bad_to_string.wren b/test/io/write_bad_to_string.wren deleted file mode 100644 index df9d3b66..00000000 --- a/test/io/write_bad_to_string.wren +++ /dev/null @@ -1,7 +0,0 @@ -class BadToString { - construct new() {} - toString { 3 } -} - -IO.write(BadToString.new()) // expect: [invalid toString] -IO.print \ No newline at end of file diff --git a/test/language/assignment/associativity.wren b/test/language/assignment/associativity.wren index e7844499..40967585 100644 --- a/test/language/assignment/associativity.wren +++ b/test/language/assignment/associativity.wren @@ -4,6 +4,6 @@ var c = "c" // Assignment is right-associative. a = b = c -IO.print(a) // expect: c -IO.print(b) // expect: c -IO.print(c) // expect: c +System.print(a) // expect: c +System.print(b) // expect: c +System.print(c) // expect: c diff --git a/test/language/assignment/global.wren b/test/language/assignment/global.wren index fa070409..07123462 100644 --- a/test/language/assignment/global.wren +++ b/test/language/assignment/global.wren @@ -1,8 +1,8 @@ var a = "before" -IO.print(a) // expect: before +System.print(a) // expect: before a = "after" -IO.print(a) // expect: after +System.print(a) // expect: after -IO.print(a = "arg") // expect: arg -IO.print(a) // expect: arg +System.print(a = "arg") // expect: arg +System.print(a) // expect: arg diff --git a/test/language/assignment/local.wren b/test/language/assignment/local.wren index 3805a7bd..926d31c2 100644 --- a/test/language/assignment/local.wren +++ b/test/language/assignment/local.wren @@ -1,10 +1,10 @@ Fn.new { var a = "before" - IO.print(a) // expect: before + System.print(a) // expect: before a = "after" - IO.print(a) // expect: after + System.print(a) // expect: after - IO.print(a = "arg") // expect: arg - IO.print(a) // expect: arg + System.print(a = "arg") // expect: arg + System.print(a) // expect: arg }.call() diff --git a/test/language/assignment/syntax.wren b/test/language/assignment/syntax.wren index f283a5bd..7cf97b47 100644 --- a/test/language/assignment/syntax.wren +++ b/test/language/assignment/syntax.wren @@ -2,10 +2,10 @@ var a = "a" var b = "b" a = b = "chain" -IO.print(a) // expect: chain -IO.print(a) // expect: chain +System.print(a) // expect: chain +System.print(a) // expect: chain // Assignment on RHS of variable. var c = a = "var" -IO.print(a) // expect: var -IO.print(c) // expect: var +System.print(a) // expect: var +System.print(c) // expect: var diff --git a/test/language/bitwise_precedence.wren b/test/language/bitwise_precedence.wren index 91651136..d685e26d 100644 --- a/test/language/bitwise_precedence.wren +++ b/test/language/bitwise_precedence.wren @@ -1,23 +1,23 @@ // << have higher precedence than |. -IO.print(2 | 1 << 1) // expect: 2 -IO.print(1 << 1 | 2) // expect: 2 +System.print(2 | 1 << 1) // expect: 2 +System.print(1 << 1 | 2) // expect: 2 // << has higher precedence than &. -IO.print(2 & 1 << 1) // expect: 2 -IO.print(1 << 1 & 2) // expect: 2 +System.print(2 & 1 << 1) // expect: 2 +System.print(1 << 1 & 2) // expect: 2 // << has higher precedence than ^. -IO.print(2 ^ 1 << 1) // expect: 0 -IO.print(1 << 1 ^ 2) // expect: 0 +System.print(2 ^ 1 << 1) // expect: 0 +System.print(1 << 1 ^ 2) // expect: 0 // & has higher precedence than |. -IO.print(1 & 1 | 2) // expect: 3 -IO.print(2 | 1 & 1) // expect: 3 +System.print(1 & 1 | 2) // expect: 3 +System.print(2 | 1 & 1) // expect: 3 // & has higher precedence than ^. -IO.print(1 & 1 ^ 2) // expect: 3 -IO.print(2 ^ 1 & 1) // expect: 3 +System.print(1 & 1 ^ 2) // expect: 3 +System.print(2 ^ 1 & 1) // expect: 3 // ^ has higher precedence than |. -IO.print(1 ^ 1 | 1) // expect: 1 -IO.print(1 | 1 ^ 1) // expect: 1 +System.print(1 ^ 1 | 1) // expect: 1 +System.print(1 | 1 ^ 1) // expect: 1 diff --git a/test/language/break/closure_in_for.wren b/test/language/break/closure_in_for.wren index 2c204f50..1d41b116 100644 --- a/test/language/break/closure_in_for.wren +++ b/test/language/break/closure_in_for.wren @@ -1,7 +1,7 @@ var f for (i in [1, 2, 3]) { var j = 4 - f = Fn.new { IO.print(i + j) } + f = Fn.new { System.print(i + j) } break } diff --git a/test/language/break/closure_in_while.wren b/test/language/break/closure_in_while.wren index 084b6c46..38457650 100644 --- a/test/language/break/closure_in_while.wren +++ b/test/language/break/closure_in_while.wren @@ -1,7 +1,7 @@ var f while (true) { var i = "i" - f = Fn.new { IO.print(i) } + f = Fn.new { System.print(i) } break } diff --git a/test/language/break/exit_local_scopes.wren b/test/language/break/exit_local_scopes.wren index fdf8344f..242f3ecb 100644 --- a/test/language/break/exit_local_scopes.wren +++ b/test/language/break/exit_local_scopes.wren @@ -1,5 +1,5 @@ for (i in 0..10) { - IO.print(i) + System.print(i) { var a = "a" diff --git a/test/language/break/in_for_loop.wren b/test/language/break/in_for_loop.wren index 67479f33..78dbb0ab 100644 --- a/test/language/break/in_for_loop.wren +++ b/test/language/break/in_for_loop.wren @@ -1,7 +1,7 @@ for (i in [1, 2, 3, 4, 5]) { - IO.print(i) + System.print(i) if (i > 2) break - IO.print(i) + System.print(i) } // expect: 1 // expect: 1 diff --git a/test/language/break/in_while_loop.wren b/test/language/break/in_while_loop.wren index 9ef4fb5f..bdc96fc4 100644 --- a/test/language/break/in_while_loop.wren +++ b/test/language/break/in_while_loop.wren @@ -1,9 +1,9 @@ var i = 0 while (true) { i = i + 1 - IO.print(i) + System.print(i) if (i > 2) break - IO.print(i) + System.print(i) } // expect: 1 // expect: 1 diff --git a/test/language/break/nested_for_loop.wren b/test/language/break/nested_for_loop.wren index 514aa620..167a4e91 100644 --- a/test/language/break/nested_for_loop.wren +++ b/test/language/break/nested_for_loop.wren @@ -1,9 +1,9 @@ for (i in 0..2) { - IO.print("outer ", i) + System.print("outer " + i.toString) if (i > 1) break for (j in 0..2) { - IO.print("inner ", j) + System.print("inner " + j.toString) if (j > 1) break } } diff --git a/test/language/break/nested_while_loop.wren b/test/language/break/nested_while_loop.wren index 7186cd7d..8146613c 100644 --- a/test/language/break/nested_while_loop.wren +++ b/test/language/break/nested_while_loop.wren @@ -1,11 +1,11 @@ var i = 0 while (true) { - IO.print("outer ", i) + System.print("outer " + i.toString) if (i > 1) break var j = 0 while (true) { - IO.print("inner ", j) + System.print("inner " + j.toString) if (j > 1) break j = j + 1 diff --git a/test/language/class/field_in_foreign_class.wren b/test/language/class/field_in_foreign_class.wren index 5b7c2c26..4049b746 100644 --- a/test/language/class/field_in_foreign_class.wren +++ b/test/language/class/field_in_foreign_class.wren @@ -1,7 +1,7 @@ foreign class Foo { bar { // Can't read a field. - IO.print(_bar) // expect error + System.print(_bar) // expect error // Or write one. _bar = "value" // expect error diff --git a/test/language/class/lowercase_name_inside_body.wren b/test/language/class/lowercase_name_inside_body.wren index 6819fd70..c2eac488 100644 --- a/test/language/class/lowercase_name_inside_body.wren +++ b/test/language/class/lowercase_name_inside_body.wren @@ -2,11 +2,11 @@ class foo { construct new() {} static callFoo { - IO.print(foo) + System.print(foo) } callFoo { - IO.print(foo) + System.print(foo) } foo { "instance foo method" } diff --git a/test/language/class/name_inside_body.wren b/test/language/class/name_inside_body.wren index 477777c0..eb1fa838 100644 --- a/test/language/class/name_inside_body.wren +++ b/test/language/class/name_inside_body.wren @@ -2,11 +2,11 @@ class Foo { construct new() {} static sayName { - IO.print(Foo) + System.print(Foo) } sayName { - IO.print(Foo) + System.print(Foo) } static toString { "Foo!" } diff --git a/test/language/closure/assign_to_closure.wren b/test/language/closure/assign_to_closure.wren index 37a76fce..9de47de5 100644 --- a/test/language/closure/assign_to_closure.wren +++ b/test/language/closure/assign_to_closure.wren @@ -4,15 +4,15 @@ var g = null { var local = "local" f = Fn.new { - IO.print(local) + System.print(local) local = "after f" - IO.print(local) + System.print(local) } g = Fn.new { - IO.print(local) + System.print(local) local = "after g" - IO.print(local) + System.print(local) } } diff --git a/test/language/closure/close_over_function_parameter.wren b/test/language/closure/close_over_function_parameter.wren index 9a786ff3..f5deaca3 100644 --- a/test/language/closure/close_over_function_parameter.wren +++ b/test/language/closure/close_over_function_parameter.wren @@ -2,7 +2,7 @@ var f = null Fn.new {|param| f = Fn.new { - IO.print(param) + System.print(param) } }.call("param") diff --git a/test/language/closure/close_over_later_variable.wren b/test/language/closure/close_over_later_variable.wren index 719b9d75..d948c7da 100644 --- a/test/language/closure/close_over_later_variable.wren +++ b/test/language/closure/close_over_later_variable.wren @@ -7,7 +7,7 @@ Fn.new { var a = "a" var b = "b" Fn.new { - IO.print(b) // expect: b - IO.print(a) // expect: a + System.print(b) // expect: b + System.print(a) // expect: a }.call() }.call() diff --git a/test/language/closure/close_over_method_parameter.wren b/test/language/closure/close_over_method_parameter.wren index f1aa8080..9b309f58 100644 --- a/test/language/closure/close_over_method_parameter.wren +++ b/test/language/closure/close_over_method_parameter.wren @@ -5,7 +5,7 @@ class Foo { method(param) { F = Fn.new { - IO.print(param) + System.print(param) } } } diff --git a/test/language/closure/closed_closure_in_function.wren b/test/language/closure/closed_closure_in_function.wren index d3e8d6c5..ea3aba50 100644 --- a/test/language/closure/closed_closure_in_function.wren +++ b/test/language/closure/closed_closure_in_function.wren @@ -3,7 +3,7 @@ var f = null { var local = "local" f = Fn.new { - IO.print(local) + System.print(local) } } diff --git a/test/language/closure/closed_closure_in_method.wren b/test/language/closure/closed_closure_in_method.wren index 44971792..027e27aa 100644 --- a/test/language/closure/closed_closure_in_method.wren +++ b/test/language/closure/closed_closure_in_method.wren @@ -7,7 +7,7 @@ var foo = null construct new() {} method { - IO.print(local) + System.print(local) } } diff --git a/test/language/closure/nested_closure.wren b/test/language/closure/nested_closure.wren index b4e239d5..234a3ae2 100644 --- a/test/language/closure/nested_closure.wren +++ b/test/language/closure/nested_closure.wren @@ -7,9 +7,9 @@ Fn.new { Fn.new { var c = "c" f = Fn.new { - IO.print(a) - IO.print(b) - IO.print(c) + System.print(a) + System.print(b) + System.print(c) } }.call() }.call() diff --git a/test/language/closure/open_closure_in_function.wren b/test/language/closure/open_closure_in_function.wren index a49585e2..34dbd58e 100644 --- a/test/language/closure/open_closure_in_function.wren +++ b/test/language/closure/open_closure_in_function.wren @@ -1,6 +1,6 @@ { var local = "local" Fn.new { - IO.print(local) // expect: local + System.print(local) // expect: local }.call() } diff --git a/test/language/closure/open_closure_in_method.wren b/test/language/closure/open_closure_in_method.wren index 977dbe59..32abd318 100644 --- a/test/language/closure/open_closure_in_method.wren +++ b/test/language/closure/open_closure_in_method.wren @@ -5,7 +5,7 @@ construct new() {} method { - IO.print(local) + System.print(local) } } diff --git a/test/language/closure/reference_closure_multiple_times.wren b/test/language/closure/reference_closure_multiple_times.wren index 0d9f79cd..98b8ea38 100644 --- a/test/language/closure/reference_closure_multiple_times.wren +++ b/test/language/closure/reference_closure_multiple_times.wren @@ -3,8 +3,8 @@ var f = null { var a = "a" f = Fn.new { - IO.print(a) - IO.print(a) + System.print(a) + System.print(a) } } diff --git a/test/language/closure/reuse_closure_slot.wren b/test/language/closure/reuse_closure_slot.wren index f9de1a4f..0125fc07 100644 --- a/test/language/closure/reuse_closure_slot.wren +++ b/test/language/closure/reuse_closure_slot.wren @@ -3,7 +3,7 @@ { var a = "a" - f = Fn.new { IO.print(a) } + f = Fn.new { System.print(a) } } { diff --git a/test/language/closure/shadow_closure_with_local.wren b/test/language/closure/shadow_closure_with_local.wren index 34f29986..c7de20e8 100644 --- a/test/language/closure/shadow_closure_with_local.wren +++ b/test/language/closure/shadow_closure_with_local.wren @@ -2,10 +2,10 @@ var foo = "closure" Fn.new { { - IO.print(foo) // expect: closure + System.print(foo) // expect: closure var foo = "shadow" - IO.print(foo) // expect: shadow + System.print(foo) // expect: shadow } - IO.print(foo) // expect: closure + System.print(foo) // expect: closure }.call() } diff --git a/test/language/comments/block.wren b/test/language/comments/block.wren index bf7d5b81..956d6832 100644 --- a/test/language/comments/block.wren +++ b/test/language/comments/block.wren @@ -1,5 +1,5 @@ // In middle of line. -IO.print/* ... */(/* */"ok"/* */) // expect: ok +System.print/* ... */(/* */"ok"/* */) // expect: ok // Nested. -IO.print(/* in /* nest */ out */"ok") // expect: ok +System.print(/* in /* nest */ out */"ok") // expect: ok diff --git a/test/language/comments/block_at_eof.wren b/test/language/comments/block_at_eof.wren index a7e1bf7a..57bbca27 100644 --- a/test/language/comments/block_at_eof.wren +++ b/test/language/comments/block_at_eof.wren @@ -1,2 +1,2 @@ -IO.print("ok") // expect: ok +System.print("ok") // expect: ok /* comment */ \ No newline at end of file diff --git a/test/language/comments/line_at_eof.wren b/test/language/comments/line_at_eof.wren index f450eab8..8df57dc0 100644 --- a/test/language/comments/line_at_eof.wren +++ b/test/language/comments/line_at_eof.wren @@ -1,2 +1,2 @@ -IO.print("ok") // expect: ok +System.print("ok") // expect: ok // comment \ No newline at end of file diff --git a/test/language/comments/unicode.wren b/test/language/comments/unicode.wren index 06e65898..c3ebc155 100644 --- a/test/language/comments/unicode.wren +++ b/test/language/comments/unicode.wren @@ -8,4 +8,4 @@ // TODO: What about combining characters? -IO.print("ok") // expect: ok +System.print("ok") // expect: ok diff --git a/test/language/comments/unterminated_block.wren b/test/language/comments/unterminated_block.wren index 1c39563d..6878f959 100644 --- a/test/language/comments/unterminated_block.wren +++ b/test/language/comments/unterminated_block.wren @@ -1,3 +1,3 @@ // expect error line 3 -IO.print("nope") /* +System.print("nope") /* oops \ No newline at end of file diff --git a/test/language/comments/unterminated_nested_block.wren b/test/language/comments/unterminated_nested_block.wren index 0afe4ff1..001df6f9 100644 --- a/test/language/comments/unterminated_nested_block.wren +++ b/test/language/comments/unterminated_nested_block.wren @@ -1,4 +1,4 @@ // expect error line 4 -IO.print("nope") /* /* /* +System.print("nope") /* /* /* */ oops \ No newline at end of file diff --git a/test/language/conditional/newlines.wren b/test/language/conditional/newlines.wren index a253b0c5..ae99fc0e 100644 --- a/test/language/conditional/newlines.wren +++ b/test/language/conditional/newlines.wren @@ -1,7 +1,7 @@ // Newline after '?'. -IO.print(true ? +System.print(true ? "yes" : "no") // expect: yes // Newline after ':'. -IO.print(false ? "yes" : +System.print(false ? "yes" : "no") // expect: no diff --git a/test/language/conditional/precedence.wren b/test/language/conditional/precedence.wren index d24a7fef..ddd08e9c 100644 --- a/test/language/conditional/precedence.wren +++ b/test/language/conditional/precedence.wren @@ -5,52 +5,52 @@ class Foo { } // Condition precedence. -IO.print(true ? 1 : 2) // expect: 1 -IO.print((true) ? 1 : 2) // expect: 1 -IO.print([true][0] ? 1 : 2) // expect: 1 -IO.print(Foo.bar ? 1 : 2) // expect: 1 -IO.print(3..4 ? 1 : 2) // expect: 1 -IO.print(3 * 4 ? 1 : 2) // expect: 1 -IO.print(3 + 4 ? 1 : 2) // expect: 1 -IO.print(true || false ? 1 : 2) // expect: 1 -IO.print(!false ? 1 : 2) // expect: 1 -IO.print(~0 ? 1 : 2) // expect: 1 -IO.print(3 is Num ? 1 : 2) // expect: 1 -IO.print(Foo.new() ? 1 : 2) // expect: 1 +System.print(true ? 1 : 2) // expect: 1 +System.print((true) ? 1 : 2) // expect: 1 +System.print([true][0] ? 1 : 2) // expect: 1 +System.print(Foo.bar ? 1 : 2) // expect: 1 +System.print(3..4 ? 1 : 2) // expect: 1 +System.print(3 * 4 ? 1 : 2) // expect: 1 +System.print(3 + 4 ? 1 : 2) // expect: 1 +System.print(true || false ? 1 : 2) // expect: 1 +System.print(!false ? 1 : 2) // expect: 1 +System.print(~0 ? 1 : 2) // expect: 1 +System.print(3 is Num ? 1 : 2) // expect: 1 +System.print(Foo.new() ? 1 : 2) // expect: 1 var a = 0 -IO.print(a = 3 ? 1 : 2) // expect: 1 -IO.print(a) // expect: 1 +System.print(a = 3 ? 1 : 2) // expect: 1 +System.print(a) // expect: 1 // Then branch precedence. -IO.print(true ? (1) : 2) // expect: 1 -IO.print(true ? [1][0] : 2) // expect: 1 -IO.print(true ? Foo.baz : 2) // expect: 1 -IO.print(true ? 3..4 : 2) // expect: 3..4 -IO.print(true ? 3 * 4 : 2) // expect: 12 -IO.print(true ? 3 + 4 : 2) // expect: 7 -IO.print(true ? 1 || false : 2) // expect: 1 -IO.print(true ? !true : 2) // expect: false -IO.print(true ? ~0 : 2) // expect: 4294967295 -IO.print(true ? 3 is Bool : 2) // expect: false -IO.print(true ? Foo.new() : 2) // expect: instance of Foo +System.print(true ? (1) : 2) // expect: 1 +System.print(true ? [1][0] : 2) // expect: 1 +System.print(true ? Foo.baz : 2) // expect: 1 +System.print(true ? 3..4 : 2) // expect: 3..4 +System.print(true ? 3 * 4 : 2) // expect: 12 +System.print(true ? 3 + 4 : 2) // expect: 7 +System.print(true ? 1 || false : 2) // expect: 1 +System.print(true ? !true : 2) // expect: false +System.print(true ? ~0 : 2) // expect: 4294967295 +System.print(true ? 3 is Bool : 2) // expect: false +System.print(true ? Foo.new() : 2) // expect: instance of Foo -IO.print(true ? a = 5 : 2) // expect: 5 -IO.print(a) // expect: 5 +System.print(true ? a = 5 : 2) // expect: 5 +System.print(a) // expect: 5 // Else branch precedence. -IO.print(false ? 1 : (2)) // expect: 2 -IO.print(false ? 1 : [2][0]) // expect: 2 -IO.print(false ? 2 : Foo.baz) // expect: 1 -IO.print(false ? 1 : 3..4) // expect: 3..4 -IO.print(false ? 1 : 3 * 4) // expect: 12 -IO.print(false ? 1 : 3 + 4) // expect: 7 -IO.print(false ? 1 : 2 || false) // expect: 2 -IO.print(false ? 1 : !false) // expect: true -IO.print(false ? 1 : ~0) // expect: 4294967295 -IO.print(false ? 1 : 3 is Num) // expect: true -IO.print(false ? 1 : Foo.new()) // expect: instance of Foo +System.print(false ? 1 : (2)) // expect: 2 +System.print(false ? 1 : [2][0]) // expect: 2 +System.print(false ? 2 : Foo.baz) // expect: 1 +System.print(false ? 1 : 3..4) // expect: 3..4 +System.print(false ? 1 : 3 * 4) // expect: 12 +System.print(false ? 1 : 3 + 4) // expect: 7 +System.print(false ? 1 : 2 || false) // expect: 2 +System.print(false ? 1 : !false) // expect: true +System.print(false ? 1 : ~0) // expect: 4294967295 +System.print(false ? 1 : 3 is Num) // expect: true +System.print(false ? 1 : Foo.new()) // expect: instance of Foo // Associativity. -IO.print(true ? 2 : true ? 4 : 5) // expect: 2 -IO.print(false ? 2 : true ? 4 : 5) // expect: 4 +System.print(true ? 2 : true ? 4 : 5) // expect: 2 +System.print(false ? 2 : true ? 4 : 5) // expect: 4 diff --git a/test/language/conditional/short_circuit.wren b/test/language/conditional/short_circuit.wren index 21f37521..5dde752f 100644 --- a/test/language/conditional/short_circuit.wren +++ b/test/language/conditional/short_circuit.wren @@ -1,2 +1,2 @@ -true ? IO.print("ok") : IO.print("no") // expect: ok -false ? IO.print("no") : IO.print("ok") // expect: ok +true ? System.print("ok") : System.print("no") // expect: ok +false ? System.print("no") : System.print("ok") // expect: ok diff --git a/test/language/constructor/cannot_be_infix.wren b/test/language/constructor/cannot_be_infix.wren index d5950e67..aa42484b 100644 --- a/test/language/constructor/cannot_be_infix.wren +++ b/test/language/constructor/cannot_be_infix.wren @@ -1,5 +1,5 @@ class Foo { this +(value) { // expect error - IO.print("ok") + System.print("ok") } } diff --git a/test/language/constructor/cannot_be_minus.wren b/test/language/constructor/cannot_be_minus.wren index 75fbe5e9..934a1e4b 100644 --- a/test/language/constructor/cannot_be_minus.wren +++ b/test/language/constructor/cannot_be_minus.wren @@ -1,5 +1,5 @@ class Foo { this -(value) { // expect error - IO.print("ok") + System.print("ok") } } diff --git a/test/language/constructor/cannot_be_setter.wren b/test/language/constructor/cannot_be_setter.wren index 773e34ff..a02092ec 100644 --- a/test/language/constructor/cannot_be_setter.wren +++ b/test/language/constructor/cannot_be_setter.wren @@ -1,5 +1,5 @@ class Foo { this name=(value) { // expect error - IO.print("ok") + System.print("ok") } } diff --git a/test/language/constructor/cannot_be_subscript.wren b/test/language/constructor/cannot_be_subscript.wren index db798d1d..b3e09401 100644 --- a/test/language/constructor/cannot_be_subscript.wren +++ b/test/language/constructor/cannot_be_subscript.wren @@ -1,5 +1,5 @@ class Foo { this [value] { // expect error - IO.print("ok") + System.print("ok") } } diff --git a/test/language/constructor/cannot_be_unary.wren b/test/language/constructor/cannot_be_unary.wren index ae15e9e3..fa7c7a26 100644 --- a/test/language/constructor/cannot_be_unary.wren +++ b/test/language/constructor/cannot_be_unary.wren @@ -1,5 +1,5 @@ class Foo { this ! { // expect error - IO.print("ok") + System.print("ok") } } diff --git a/test/language/constructor/cannot_call_initializer.wren b/test/language/constructor/cannot_call_initializer.wren index 56a2993d..06e7e3cc 100644 --- a/test/language/constructor/cannot_call_initializer.wren +++ b/test/language/constructor/cannot_call_initializer.wren @@ -1,6 +1,6 @@ class Foo { construct new() { - IO.print("ok") + System.print("ok") } } diff --git a/test/language/constructor/named.wren b/test/language/constructor/named.wren index b1fc23a1..2a0f2c50 100644 --- a/test/language/constructor/named.wren +++ b/test/language/constructor/named.wren @@ -5,10 +5,10 @@ class Foo { toString { _field } } -IO.print(Foo.named()) // expect: named -IO.print(Foo.other()) // expect: other +System.print(Foo.named()) // expect: named +System.print(Foo.other()) // expect: other // Returns the new instance. var foo = Foo.named() -IO.print(foo is Foo) // expect: true -IO.print(foo.toString) // expect: named +System.print(foo is Foo) // expect: true +System.print(foo.toString) // expect: named diff --git a/test/language/constructor/no_parameter_list.wren b/test/language/constructor/no_parameter_list.wren index 6de9df1b..5c0e232a 100644 --- a/test/language/constructor/no_parameter_list.wren +++ b/test/language/constructor/no_parameter_list.wren @@ -1,5 +1,5 @@ class Foo { this new { // expect error - IO.print("ok") + System.print("ok") } } diff --git a/test/language/constructor/superclass.wren b/test/language/constructor/superclass.wren index e292c513..f645f39e 100644 --- a/test/language/constructor/superclass.wren +++ b/test/language/constructor/superclass.wren @@ -1,6 +1,6 @@ class A { construct new(arg) { - IO.print("new A ", arg) + System.print("new A " + arg) _field = arg } @@ -10,7 +10,7 @@ class A { class B is A { construct new(arg1, arg2) { super(arg2) - IO.print("new B ", arg1) + System.print("new B " + arg1) _field = arg1 } @@ -20,7 +20,7 @@ class B is A { class C is B { construct new() { super("one", "two") - IO.print("new C") + System.print("new C") _field = "c" } @@ -31,10 +31,10 @@ var c = C.new() // expect: new A two // expect: new B one // expect: new C -IO.print(c is A) // expect: true -IO.print(c is B) // expect: true -IO.print(c is C) // expect: true +System.print(c is A) // expect: true +System.print(c is B) // expect: true +System.print(c is C) // expect: true -IO.print(c.aField) // expect: two -IO.print(c.bField) // expect: one -IO.print(c.cField) // expect: c +System.print(c.aField) // expect: two +System.print(c.bField) // expect: one +System.print(c.cField) // expect: c diff --git a/test/language/empty_block.wren b/test/language/empty_block.wren index cfe778ac..26f6fb43 100644 --- a/test/language/empty_block.wren +++ b/test/language/empty_block.wren @@ -4,4 +4,4 @@ if (true) {} if (false) {} else {} -IO.print("ok") // expect: ok \ No newline at end of file +System.print("ok") // expect: ok \ No newline at end of file diff --git a/test/language/fiber/closure.wren b/test/language/fiber/closure.wren index 8a720dd7..5bf8db66 100644 --- a/test/language/fiber/closure.wren +++ b/test/language/fiber/closure.wren @@ -4,16 +4,16 @@ var closure { var a = "before" fiber = Fiber.new { - IO.print(a) + System.print(a) Fiber.yield() a = "after" Fiber.yield() - IO.print(a) + System.print(a) a = "final" } closure = Fn.new { - IO.print(a) + System.print(a) } } diff --git a/test/language/field/closure.wren b/test/language/field/closure.wren index 3f0c27ba..f8f34281 100644 --- a/test/language/field/closure.wren +++ b/test/language/field/closure.wren @@ -11,6 +11,6 @@ class Foo { } var foo = Foo.new() -IO.print(foo.closeOverGet.call()) // expect: Foo field +System.print(foo.closeOverGet.call()) // expect: Foo field foo.closeOverSet.call() -IO.print(foo.closeOverGet.call()) // expect: new value +System.print(foo.closeOverGet.call()) // expect: new value diff --git a/test/language/field/default_to_null.wren b/test/language/field/default_to_null.wren index 5b834f71..9cc0df1e 100644 --- a/test/language/field/default_to_null.wren +++ b/test/language/field/default_to_null.wren @@ -1,6 +1,6 @@ class Foo { construct new() {} - write { IO.print(_field) } + write { System.print(_field) } } Foo.new().write // expect: null diff --git a/test/language/field/multiple.wren b/test/language/field/multiple.wren index 4c6f7e45..6f61e489 100644 --- a/test/language/field/multiple.wren +++ b/test/language/field/multiple.wren @@ -10,11 +10,11 @@ class Foo { } write { - IO.print(_a) - IO.print(_b) - IO.print(_c) - IO.print(_d) - IO.print(_e) + System.print(_a) + System.print(_b) + System.print(_c) + System.print(_d) + System.print(_e) } } diff --git a/test/language/field/nested_class.wren b/test/language/field/nested_class.wren index f23fed32..403518c1 100644 --- a/test/language/field/nested_class.wren +++ b/test/language/field/nested_class.wren @@ -3,19 +3,19 @@ class Outer { method { _field = "outer" - IO.print(_field) // expect: outer + System.print(_field) // expect: outer class Inner { construct new() {} method { _field = "inner" - IO.print(_field) // expect: inner + System.print(_field) // expect: inner } } Inner.new().method - IO.print(_field) // expect: outer + System.print(_field) // expect: outer } } diff --git a/test/language/field/object_reference.wren b/test/language/field/object_reference.wren index 5f29fa62..4067684f 100644 --- a/test/language/field/object_reference.wren +++ b/test/language/field/object_reference.wren @@ -11,7 +11,7 @@ class Node { _left.write() } - IO.print(_value) + System.print(_value) if (_right is Node) { _right.write() diff --git a/test/language/field/use_before_set.wren b/test/language/field/use_before_set.wren index d5a56f65..dc0b51a1 100644 --- a/test/language/field/use_before_set.wren +++ b/test/language/field/use_before_set.wren @@ -1,6 +1,6 @@ class Foo { construct new() {} - write { IO.print(_field) } // Compile a use of the field... + write { System.print(_field) } // Compile a use of the field... init { _field = "value" } // ...before an assignment to it. } diff --git a/test/language/for/close_over_loop_variable.wren b/test/language/for/close_over_loop_variable.wren index 21e50d14..7f1a242a 100644 --- a/test/language/for/close_over_loop_variable.wren +++ b/test/language/for/close_over_loop_variable.wren @@ -1,7 +1,7 @@ var list = [] for (i in [1, 2, 3]) { - list.add(Fn.new { IO.print(i) }) + list.add(Fn.new { System.print(i) }) } for (f in list) f.call() diff --git a/test/language/for/closure_in_body.wren b/test/language/for/closure_in_body.wren index 1dcd20e2..a1bbaecf 100644 --- a/test/language/for/closure_in_body.wren +++ b/test/language/for/closure_in_body.wren @@ -2,7 +2,7 @@ var list = [] for (i in [1, 2, 3]) { var j = i + 1 - list.add(Fn.new { IO.print(j) }) + list.add(Fn.new { System.print(j) }) } for (f in list) f.call() diff --git a/test/language/for/newline_after_for.wren b/test/language/for/newline_after_for.wren index 9cc6527f..43fbd993 100644 --- a/test/language/for/newline_after_for.wren +++ b/test/language/for/newline_after_for.wren @@ -1,2 +1,2 @@ for // expect error -(i in [1, 2, 3]) IO.print(i) +(i in [1, 2, 3]) System.print(i) diff --git a/test/language/for/newline_before_in.wren b/test/language/for/newline_before_in.wren index 5412c680..51264b54 100644 --- a/test/language/for/newline_before_in.wren +++ b/test/language/for/newline_before_in.wren @@ -1,2 +1,2 @@ for (i // expect error - in [1]) IO.print(i) + in [1]) System.print(i) diff --git a/test/language/for/only_evaluate_sequence_once.wren b/test/language/for/only_evaluate_sequence_once.wren index 9053a4a5..e8d06c27 100644 --- a/test/language/for/only_evaluate_sequence_once.wren +++ b/test/language/for/only_evaluate_sequence_once.wren @@ -1,9 +1,9 @@ var f = Fn.new { - IO.print("evaluate sequence") + System.print("evaluate sequence") return [1, 2, 3] } -for (i in f.call()) IO.print(i) +for (i in f.call()) System.print(i) // expect: evaluate sequence // expect: 1 // expect: 2 diff --git a/test/language/for/return_closure.wren b/test/language/for/return_closure.wren index 8643ef3f..cbb2dd3c 100644 --- a/test/language/for/return_closure.wren +++ b/test/language/for/return_closure.wren @@ -1,6 +1,6 @@ var f = Fn.new { for (i in [1, 2, 3]) { - return Fn.new { IO.print(i) } + return Fn.new { System.print(i) } } } diff --git a/test/language/for/return_inside.wren b/test/language/for/return_inside.wren index 6e92f0b9..1640973a 100644 --- a/test/language/for/return_inside.wren +++ b/test/language/for/return_inside.wren @@ -4,5 +4,5 @@ var f = Fn.new { } } -IO.print(f.call()) +System.print(f.call()) // expect: 1 diff --git a/test/language/for/syntax.wren b/test/language/for/syntax.wren index 3325ff2b..f4c2aa28 100644 --- a/test/language/for/syntax.wren +++ b/test/language/for/syntax.wren @@ -1,14 +1,14 @@ // Single-expression body. -for (i in [1]) IO.print(i) +for (i in [1]) System.print(i) // expect: 1 // Block body. for (i in [1]) { - IO.print(i) + System.print(i) } // expect: 1 // Newline after "in". for (i in - [1]) IO.print(i) + [1]) System.print(i) // expect: 1 \ No newline at end of file diff --git a/test/language/for/truth.wren b/test/language/for/truth.wren index ffbfe2b1..72adae79 100644 --- a/test/language/for/truth.wren +++ b/test/language/for/truth.wren @@ -6,27 +6,27 @@ class Iter { // False and null are false. for (n in Iter.new(false)) { - IO.print("bad") + System.print("bad") break } for (n in Iter.new(null)) { - IO.print("bad") + System.print("bad") break } // Everything else is true. for (n in Iter.new(true)) { - IO.print("true") // expect: true + System.print("true") // expect: true break } for (n in Iter.new(0)) { - IO.print(0) // expect: 0 + System.print(0) // expect: 0 break } for (n in Iter.new("")) { - IO.print("string") // expect: string + System.print("string") // expect: string break } diff --git a/test/language/function/empty_body.wren b/test/language/function/empty_body.wren index 773dcfed..2354bc9c 100644 --- a/test/language/function/empty_body.wren +++ b/test/language/function/empty_body.wren @@ -1,2 +1,2 @@ var f = Fn.new {} -IO.print(f.call()) // expect: null +System.print(f.call()) // expect: null diff --git a/test/language/function/newline_body.wren b/test/language/function/newline_body.wren index 9151ea2d..b6eb0ff5 100644 --- a/test/language/function/newline_body.wren +++ b/test/language/function/newline_body.wren @@ -1,4 +1,4 @@ var f = Fn.new { // Hi. } -IO.print(f.call()) // expect: null +System.print(f.call()) // expect: null diff --git a/test/language/function/newline_in_expression_block.wren b/test/language/function/newline_in_expression_block.wren index 099905ed..9e14a314 100644 --- a/test/language/function/newline_in_expression_block.wren +++ b/test/language/function/newline_in_expression_block.wren @@ -1,2 +1,2 @@ -Fn.new { IO.print("ok") // expect error +Fn.new { System.print("ok") // expect error }.call() diff --git a/test/language/function/no_newline_before_close.wren b/test/language/function/no_newline_before_close.wren index 060db9a8..00164bf7 100644 --- a/test/language/function/no_newline_before_close.wren +++ b/test/language/function/no_newline_before_close.wren @@ -1,2 +1,2 @@ Fn.new { - IO.print("ok") } // expect error \ No newline at end of file + System.print("ok") } // expect error \ No newline at end of file diff --git a/test/language/function/parameters.wren b/test/language/function/parameters.wren index 98c79f88..78225c1f 100644 --- a/test/language/function/parameters.wren +++ b/test/language/function/parameters.wren @@ -1,50 +1,50 @@ var f0 = Fn.new { 0 } -IO.print(f0.call()) // expect: 0 +System.print(f0.call()) // expect: 0 var f1 = Fn.new {|a| a } -IO.print(f1.call(1)) // expect: 1 +System.print(f1.call(1)) // expect: 1 var f2 = Fn.new {|a, b| a + b } -IO.print(f2.call(1, 2)) // expect: 3 +System.print(f2.call(1, 2)) // expect: 3 var f3 = Fn.new {|a, b, c| a + b + c } -IO.print(f3.call(1, 2, 3)) // expect: 6 +System.print(f3.call(1, 2, 3)) // expect: 6 var f4 = Fn.new {|a, b, c, d| a + b + c + d } -IO.print(f4.call(1, 2, 3, 4)) // expect: 10 +System.print(f4.call(1, 2, 3, 4)) // expect: 10 var f5 = Fn.new {|a, b, c, d, e| a + b + c + d + e } -IO.print(f5.call(1, 2, 3, 4, 5)) // expect: 15 +System.print(f5.call(1, 2, 3, 4, 5)) // expect: 15 var f6 = Fn.new {|a, b, c, d, e, f| a + b + c + d + e + f } -IO.print(f6.call(1, 2, 3, 4, 5, 6)) // expect: 21 +System.print(f6.call(1, 2, 3, 4, 5, 6)) // expect: 21 var f7 = Fn.new {|a, b, c, d, e, f, g| a + b + c + d + e + f + g } -IO.print(f7.call(1, 2, 3, 4, 5, 6, 7)) // expect: 28 +System.print(f7.call(1, 2, 3, 4, 5, 6, 7)) // expect: 28 var f8 = Fn.new {|a, b, c, d, e, f, g, h| a + b + c + d + e + f + g + h } -IO.print(f8.call(1, 2, 3, 4, 5, 6, 7, 8)) // expect: 36 +System.print(f8.call(1, 2, 3, 4, 5, 6, 7, 8)) // expect: 36 var f9 = Fn.new {|a, b, c, d, e, f, g, h, i| a + b + c + d + e + f + g + h + i } -IO.print(f9.call(1, 2, 3, 4, 5, 6, 7, 8, 9)) // expect: 45 +System.print(f9.call(1, 2, 3, 4, 5, 6, 7, 8, 9)) // expect: 45 var f10 = Fn.new {|a, b, c, d, e, f, g, h, i, j| a + b + c + d + e + f + g + h + i + j } -IO.print(f10.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) // expect: 55 +System.print(f10.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) // expect: 55 var f11 = Fn.new {|a, b, c, d, e, f, g, h, i, j, k| a + b + c + d + e + f + g + h + i + j + k } -IO.print(f11.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) // expect: 66 +System.print(f11.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) // expect: 66 var f12 = Fn.new {|a, b, c, d, e, f, g, h, i, j, k, l| a + b + c + d + e + f + g + h + i + j + k + l } -IO.print(f12.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) // expect: 78 +System.print(f12.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) // expect: 78 var f13 = Fn.new {|a, b, c, d, e, f, g, h, i, j, k, l, m| a + b + c + d + e + f + g + h + i + j + k + l + m } -IO.print(f13.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)) // expect: 91 +System.print(f13.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)) // expect: 91 var f14 = Fn.new {|a, b, c, d, e, f, g, h, i, j, k, l, m, n| a + b + c + d + e + f + g + h + i + j + k + l + m + n } -IO.print(f14.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)) // expect: 105 +System.print(f14.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)) // expect: 105 var f15 = Fn.new {|a, b, c, d, e, f, g, h, i, j, k, l, m, n, o| a + b + c + d + e + f + g + h + i + j + k + l + m + n + o } -IO.print(f15.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) // expect: 120 +System.print(f15.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) // expect: 120 var f16 = Fn.new {|a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p| a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p } -IO.print(f16.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)) // expect: 136 +System.print(f16.call(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)) // expect: 136 diff --git a/test/language/function/syntax.wren b/test/language/function/syntax.wren index 2672d6be..8e94c2ca 100644 --- a/test/language/function/syntax.wren +++ b/test/language/function/syntax.wren @@ -1,25 +1,25 @@ // Single expression body. -Fn.new { IO.print("ok") }.call() // expect: ok +Fn.new { System.print("ok") }.call() // expect: ok // Curly body. Fn.new { - IO.print("ok") // expect: ok + System.print("ok") // expect: ok }.call() // Multiple statements. Fn.new { - IO.print("1") // expect: 1 - IO.print("2") // expect: 2 + System.print("1") // expect: 1 + System.print("2") // expect: 2 }.call() // Extra newlines. Fn.new { - IO.print("1") // expect: 1 + System.print("1") // expect: 1 - IO.print("2") // expect: 2 + System.print("2") // expect: 2 }.call() diff --git a/test/language/if/dangling_else.wren b/test/language/if/dangling_else.wren index a1c50de8..d831be98 100644 --- a/test/language/if/dangling_else.wren +++ b/test/language/if/dangling_else.wren @@ -1,3 +1,3 @@ // A dangling else binds to the right-most if. -if (true) if (false) IO.print("bad") else IO.print("good") // expect: good -if (false) if (true) IO.print("bad") else IO.print("bad") +if (true) if (false) System.print("bad") else System.print("good") // expect: good +if (false) if (true) System.print("bad") else System.print("bad") diff --git a/test/language/if/else.wren b/test/language/if/else.wren index 69a9914e..2fa42a2a 100644 --- a/test/language/if/else.wren +++ b/test/language/if/else.wren @@ -1,6 +1,6 @@ // Evaluate the 'else' expression if the condition is false. -if (true) IO.print("good") else IO.print("bad") // expect: good -if (false) IO.print("bad") else IO.print("good") // expect: good +if (true) System.print("good") else System.print("bad") // expect: good +if (false) System.print("bad") else System.print("good") // expect: good // Allow block body. -if (false) null else { IO.print("block") } // expect: block +if (false) null else { System.print("block") } // expect: block diff --git a/test/language/if/if.wren b/test/language/if/if.wren index 11e5e0ea..3dd98358 100644 --- a/test/language/if/if.wren +++ b/test/language/if/if.wren @@ -1,10 +1,10 @@ // Evaluate the 'then' expression if the condition is true. -if (true) IO.print("good") // expect: good -if (false) IO.print("bad") +if (true) System.print("good") // expect: good +if (false) System.print("bad") // Allow block body. -if (true) { IO.print("block") } // expect: block +if (true) { System.print("block") } // expect: block // Assignment in if condition. var a = false -if (a = true) IO.print(a) // expect: true +if (a = true) System.print(a) // expect: true diff --git a/test/language/if/newline_after_if.wren b/test/language/if/newline_after_if.wren index 3a2e49fc..213af793 100644 --- a/test/language/if/newline_after_if.wren +++ b/test/language/if/newline_after_if.wren @@ -1,2 +1,2 @@ if // expect error -(true) IO.print("bad") +(true) System.print("bad") diff --git a/test/language/if/truth.wren b/test/language/if/truth.wren index 57e2a038..ad4964b2 100644 --- a/test/language/if/truth.wren +++ b/test/language/if/truth.wren @@ -1,8 +1,8 @@ // False and null are false. -if (false) IO.print("bad") else IO.print("false") // expect: false -if (null) IO.print("bad") else IO.print("null") // expect: null +if (false) System.print("bad") else System.print("false") // expect: false +if (null) System.print("bad") else System.print("null") // expect: null // Everything else is true. -if (true) IO.print(true) // expect: true -if (0) IO.print(0) // expect: 0 -if ("") IO.print("empty") // expect: empty +if (true) System.print(true) // expect: true +if (0) System.print(0) // expect: 0 +if ("") System.print("empty") // expect: empty diff --git a/test/language/ignore_carriage_returns.wren b/test/language/ignore_carriage_returns.wren index 79e2968f..2de5f7ad 100644 --- a/test/language/ignore_carriage_returns.wren +++ b/test/language/ignore_carriage_returns.wren @@ -1,6 +1,6 @@ // Sprinkle some carriage returns to ensure they are ignored anywhere: -IO .print("one" ) -IO.print ("two") +System .print("one" ) +System.print ("two") // Generate a compile error so we can test that the line number is correct. + * // expect error diff --git a/test/language/implicit_receiver/inherited_methods.wren b/test/language/implicit_receiver/inherited_methods.wren index 12888cc7..319b5c13 100644 --- a/test/language/implicit_receiver/inherited_methods.wren +++ b/test/language/implicit_receiver/inherited_methods.wren @@ -2,15 +2,15 @@ class Foo { construct new() {} getter { - IO.print("getter") + System.print("getter") } setter=(value) { - IO.print("setter") + System.print("setter") } method(a) { - IO.print("method") + System.print("method") } } diff --git a/test/language/implicit_receiver/instance_methods.wren b/test/language/implicit_receiver/instance_methods.wren index a3e5ab13..b07afbb1 100644 --- a/test/language/implicit_receiver/instance_methods.wren +++ b/test/language/implicit_receiver/instance_methods.wren @@ -2,15 +2,15 @@ class Foo { construct new() {} getter { - IO.print("getter") + System.print("getter") } setter=(value) { - IO.print("setter") + System.print("setter") } method(a) { - IO.print("method") + System.print("method") } test { diff --git a/test/language/implicit_receiver/locals_shadow_getter.wren b/test/language/implicit_receiver/locals_shadow_getter.wren index f04ef590..71827782 100644 --- a/test/language/implicit_receiver/locals_shadow_getter.wren +++ b/test/language/implicit_receiver/locals_shadow_getter.wren @@ -4,15 +4,15 @@ class Foo { bar { "getter" } test { - IO.print(bar) // expect: getter + System.print(bar) // expect: getter { - IO.print(bar) // expect: getter + System.print(bar) // expect: getter var bar = "local" - IO.print(bar) // expect: local + System.print(bar) // expect: local } - IO.print(bar) // expect: getter + System.print(bar) // expect: getter } } diff --git a/test/language/implicit_receiver/locals_shadow_setter.wren b/test/language/implicit_receiver/locals_shadow_setter.wren index 56bea7c7..ee084940 100644 --- a/test/language/implicit_receiver/locals_shadow_setter.wren +++ b/test/language/implicit_receiver/locals_shadow_setter.wren @@ -2,7 +2,7 @@ class Foo { construct new() {} bar=(value) { - IO.print("setter") + System.print("setter") return value } diff --git a/test/language/implicit_receiver/nested_class.wren b/test/language/implicit_receiver/nested_class.wren index 738447b9..eef0cf34 100644 --- a/test/language/implicit_receiver/nested_class.wren +++ b/test/language/implicit_receiver/nested_class.wren @@ -2,15 +2,15 @@ class Outer { construct new() {} getter { - IO.print("outer getter") + System.print("outer getter") } setter=(value) { - IO.print("outer setter") + System.print("outer setter") } method(a) { - IO.print("outer method") + System.print("outer method") } test { @@ -22,15 +22,15 @@ class Outer { construct new() {} getter { - IO.print("inner getter") + System.print("inner getter") } setter=(value) { - IO.print("inner setter") + System.print("inner setter") } method(a) { - IO.print("inner method") + System.print("inner method") } test { diff --git a/test/language/implicit_receiver/static_methods.wren b/test/language/implicit_receiver/static_methods.wren index 95631ca8..4309c11c 100644 --- a/test/language/implicit_receiver/static_methods.wren +++ b/test/language/implicit_receiver/static_methods.wren @@ -1,14 +1,14 @@ class Foo { static getter { - IO.print("getter") + System.print("getter") } static setter=(value) { - IO.print("setter") + System.print("setter") } static method(a) { - IO.print("method") + System.print("method") } static test { diff --git a/test/language/inheritance/do_not_inherit_static_methods.wren b/test/language/inheritance/do_not_inherit_static_methods.wren index 36da1395..279ca172 100644 --- a/test/language/inheritance/do_not_inherit_static_methods.wren +++ b/test/language/inheritance/do_not_inherit_static_methods.wren @@ -1,5 +1,5 @@ class Foo { - static methodOnFoo { IO.print("foo") } + static methodOnFoo { System.print("foo") } } class Bar is Foo {} diff --git a/test/language/inheritance/inherit_fields.wren b/test/language/inheritance/inherit_fields.wren index d25e1e38..6c1be664 100644 --- a/test/language/inheritance/inherit_fields.wren +++ b/test/language/inheritance/inherit_fields.wren @@ -7,8 +7,8 @@ class Foo { } fooPrint { - IO.print(_field1) - IO.print(_field2) + System.print(_field1) + System.print(_field2) } } @@ -21,8 +21,8 @@ class Bar is Foo { } barPrint { - IO.print(_field1) - IO.print(_field2) + System.print(_field1) + System.print(_field2) } } diff --git a/test/language/inheritance/inherit_from_closure.wren b/test/language/inheritance/inherit_from_closure.wren index c79e8d01..acb4eeab 100644 --- a/test/language/inheritance/inherit_from_closure.wren +++ b/test/language/inheritance/inherit_from_closure.wren @@ -2,7 +2,7 @@ var ClosureType { var a = "a" - ClosureType = Fn.new { IO.print(a) }.type + ClosureType = Fn.new { System.print(a) }.type } class Subclass is ClosureType {} // expect runtime error: Class 'Subclass' cannot inherit from built-in class 'Fn'. diff --git a/test/language/inheritance/inherit_methods.wren b/test/language/inheritance/inherit_methods.wren index d71b696b..fda31b8e 100644 --- a/test/language/inheritance/inherit_methods.wren +++ b/test/language/inheritance/inherit_methods.wren @@ -1,16 +1,16 @@ class Foo { - methodOnFoo { IO.print("foo") } - method(a) { IO.print("foo") } - method(a, b, c) { IO.print("foo") } - override { IO.print("foo") } + methodOnFoo { System.print("foo") } + method(a) { System.print("foo") } + method(a, b, c) { System.print("foo") } + override { System.print("foo") } } class Bar is Foo { construct new() {} - methodOnBar { IO.print("bar") } - method(a, b) { IO.print("bar") } - method(a, b, c, d) { IO.print("bar") } - override { IO.print("bar") } + methodOnBar { System.print("bar") } + method(a, b) { System.print("bar") } + method(a, b, c, d) { System.print("bar") } + override { System.print("bar") } } var bar = Bar.new() diff --git a/test/language/inheritance/inherited_fields_in_closure.wren b/test/language/inheritance/inherited_fields_in_closure.wren index c9e8bfb1..3dddf275 100644 --- a/test/language/inheritance/inherited_fields_in_closure.wren +++ b/test/language/inheritance/inherited_fields_in_closure.wren @@ -26,11 +26,11 @@ class Bar is Foo { } var bar = Bar.new() -IO.print(bar.closeOverFooGet.call().call()) // expect: Foo field -IO.print(bar.closeOverBarGet.call().call()) // expect: Bar field +System.print(bar.closeOverFooGet.call().call()) // expect: Foo field +System.print(bar.closeOverBarGet.call().call()) // expect: Bar field bar.closeOverFooSet.call().call() -IO.print(bar.closeOverFooGet.call().call()) // expect: new foo value -IO.print(bar.closeOverBarGet.call().call()) // expect: Bar field +System.print(bar.closeOverFooGet.call().call()) // expect: new foo value +System.print(bar.closeOverBarGet.call().call()) // expect: Bar field bar.closeOverBarSet.call().call() -IO.print(bar.closeOverFooGet.call().call()) // expect: new foo value -IO.print(bar.closeOverBarGet.call().call()) // expect: new bar value +System.print(bar.closeOverFooGet.call().call()) // expect: new foo value +System.print(bar.closeOverBarGet.call().call()) // expect: new bar value diff --git a/test/language/inheritance/is.wren b/test/language/inheritance/is.wren index d07d776a..f8c73850 100644 --- a/test/language/inheritance/is.wren +++ b/test/language/inheritance/is.wren @@ -11,12 +11,12 @@ var a = A.new() var b = B.new() var c = C.new() -IO.print(a is A) // expect: true -IO.print(a is B) // expect: false -IO.print(a is C) // expect: false -IO.print(b is A) // expect: true -IO.print(b is B) // expect: true -IO.print(b is C) // expect: false -IO.print(c is A) // expect: true -IO.print(c is B) // expect: true -IO.print(c is C) // expect: true +System.print(a is A) // expect: true +System.print(a is B) // expect: false +System.print(a is C) // expect: false +System.print(b is A) // expect: true +System.print(b is B) // expect: true +System.print(b is C) // expect: false +System.print(c is A) // expect: true +System.print(c is B) // expect: true +System.print(c is C) // expect: true diff --git a/test/language/is/is.wren b/test/language/is/is.wren index fe4c41ff..e367636d 100644 --- a/test/language/is/is.wren +++ b/test/language/is/is.wren @@ -1,33 +1,33 @@ -IO.print(Num is Class) // expect: true -IO.print(true is Bool) // expect: true -IO.print(Fn.new { 1 } is Fn) // expect: true -IO.print(123 is Num) // expect: true -IO.print(null is Null) // expect: true -IO.print("s" is String) // expect: true +System.print(Num is Class) // expect: true +System.print(true is Bool) // expect: true +System.print(Fn.new { 1 } is Fn) // expect: true +System.print(123 is Num) // expect: true +System.print(null is Null) // expect: true +System.print("s" is String) // expect: true -IO.print(Num is Bool) // expect: false -IO.print(null is Class) // expect: false -IO.print(true is Fn) // expect: false -IO.print(Fn.new { 1 } is Num) // expect: false -IO.print("s" is Null) // expect: false -IO.print(123 is String) // expect: false +System.print(Num is Bool) // expect: false +System.print(null is Class) // expect: false +System.print(true is Fn) // expect: false +System.print(Fn.new { 1 } is Num) // expect: false +System.print("s" is Null) // expect: false +System.print(123 is String) // expect: false // Everything extends Object. -IO.print(Num is Object) // expect: true -IO.print(null is Object) // expect: true -IO.print(true is Object) // expect: true -IO.print(Fn.new { 1 } is Object) // expect: true -IO.print("s" is Object) // expect: true -IO.print(123 is Object) // expect: true +System.print(Num is Object) // expect: true +System.print(null is Object) // expect: true +System.print(true is Object) // expect: true +System.print(Fn.new { 1 } is Object) // expect: true +System.print("s" is Object) // expect: true +System.print(123 is Object) // expect: true // Classes extend Class. -IO.print(Num is Class) // expect: true -IO.print(null is Class) // expect: false -IO.print(true is Class) // expect: false -IO.print(Fn.new { 1 } is Class) // expect: false -IO.print("s" is Class) // expect: false -IO.print(123 is Class) // expect: false +System.print(Num is Class) // expect: true +System.print(null is Class) // expect: false +System.print(true is Class) // expect: false +System.print(Fn.new { 1 } is Class) // expect: false +System.print("s" is Class) // expect: false +System.print(123 is Class) // expect: false // Ignore newline after "is". -IO.print(123 is +System.print(123 is Num) // expect: true \ No newline at end of file diff --git a/test/language/list/grow_shrink.wren b/test/language/list/grow_shrink.wren index a1e9fd58..fc06fb54 100644 --- a/test/language/list/grow_shrink.wren +++ b/test/language/list/grow_shrink.wren @@ -8,4 +8,4 @@ for (i in 0..195) { list.removeAt(-1) } -IO.print(list) // expect: [0, 1, 2, 3, 4] +System.print(list) // expect: [0, 1, 2, 3, 4] diff --git a/test/language/list/newlines.wren b/test/language/list/newlines.wren index 61296116..f8d49b0e 100644 --- a/test/language/list/newlines.wren +++ b/test/language/list/newlines.wren @@ -6,19 +6,19 @@ var list = [ ] -IO.print(list[0]) // expect: a -IO.print(list[1]) // expect: b +System.print(list[0]) // expect: a +System.print(list[1]) // expect: b // Newline after trailing comma. list = ["c", ] -IO.print(list[0]) // expect: c +System.print(list[0]) // expect: c // Newline in empty list. list = [ ] -IO.print(list.count) // expect: 0 +System.print(list.count) // expect: 0 diff --git a/test/language/list/trailing_comma.wren b/test/language/list/trailing_comma.wren index e6f64348..66965555 100644 --- a/test/language/list/trailing_comma.wren +++ b/test/language/list/trailing_comma.wren @@ -1,4 +1,4 @@ var list = ["a", "b",] -IO.print(list[0]) // expect: a -IO.print(list[1]) // expect: b +System.print(list[0]) // expect: a +System.print(list[1]) // expect: b diff --git a/test/language/logical_operator/and.wren b/test/language/logical_operator/and.wren index db8c9618..1b793afb 100644 --- a/test/language/logical_operator/and.wren +++ b/test/language/logical_operator/and.wren @@ -1,20 +1,20 @@ // Note: These tests implicitly depend on ints being truthy. -// Also rely on IO.print() returning its argument. +// Also rely on System.print() returning its argument. // Return the first non-true argument. -IO.print(false && 1) // expect: false -IO.print(true && 1) // expect: 1 -IO.print(1 && 2 && false) // expect: false +System.print(false && 1) // expect: false +System.print(true && 1) // expect: 1 +System.print(1 && 2 && false) // expect: false // Return the last argument if all are true. -IO.print(1 && true) // expect: true -IO.print(1 && 2 && 3) // expect: 3 +System.print(1 && true) // expect: true +System.print(1 && 2 && 3) // expect: 3 // Short-circuit at the first false argument. -IO.print(true) && // expect: true - IO.print(false) && // expect: false - IO.print(false) // should not print +System.print(true) && // expect: true + System.print(false) && // expect: false + System.print(false) // should not print // Swallow a trailing newline. -IO.print(true && +System.print(true && true) // expect: true diff --git a/test/language/logical_operator/and_truth.wren b/test/language/logical_operator/and_truth.wren index 4c4e365a..deef46a1 100644 --- a/test/language/logical_operator/and_truth.wren +++ b/test/language/logical_operator/and_truth.wren @@ -1,8 +1,8 @@ // False and null are false. -IO.print(false && "bad") // expect: false -IO.print(null && "bad") // expect: null +System.print(false && "bad") // expect: false +System.print(null && "bad") // expect: null // Everything else is true. -IO.print(true && "ok") // expect: ok -IO.print(0 && "ok") // expect: ok -IO.print("" && "ok") // expect: ok +System.print(true && "ok") // expect: ok +System.print(0 && "ok") // expect: ok +System.print("" && "ok") // expect: ok diff --git a/test/language/logical_operator/or.wren b/test/language/logical_operator/or.wren index 3e4779e3..6645f1bf 100644 --- a/test/language/logical_operator/or.wren +++ b/test/language/logical_operator/or.wren @@ -1,20 +1,20 @@ // Note: These tests implicitly depend on ints being truthy. -// Also rely on IO.print() returning its argument. +// Also rely on System.print() returning its argument. // Return the first true argument. -IO.print(1 || true) // expect: 1 -IO.print(false || 1) // expect: 1 -IO.print(false || false || true) // expect: true +System.print(1 || true) // expect: 1 +System.print(false || 1) // expect: 1 +System.print(false || false || true) // expect: true // Return the last argument if all are false. -IO.print(false || false) // expect: false -IO.print(false || false || false) // expect: false +System.print(false || false) // expect: false +System.print(false || false || false) // expect: false // Short-circuit at the first true argument. -IO.print(false) || // expect: false - IO.print(true) || // expect: true - IO.print(true) // should not print +System.print(false) || // expect: false + System.print(true) || // expect: true + System.print(true) // should not print // Swallow a trailing newline. -IO.print(true || +System.print(true || true) // expect: true diff --git a/test/language/logical_operator/or_truth.wren b/test/language/logical_operator/or_truth.wren index fd6aa2fc..e7f39e26 100644 --- a/test/language/logical_operator/or_truth.wren +++ b/test/language/logical_operator/or_truth.wren @@ -1,8 +1,8 @@ // False and null are false. -IO.print(false || "ok") // expect: ok -IO.print(null || "ok") // expect: ok +System.print(false || "ok") // expect: ok +System.print(null || "ok") // expect: ok // Everything else is true. -IO.print(true || "ok") // expect: true -IO.print(0 || "ok") // expect: 0 -IO.print("s" || "ok") // expect: s +System.print(true || "ok") // expect: true +System.print(0 || "ok") // expect: 0 +System.print("s" || "ok") // expect: s diff --git a/test/language/map/grow_and_shrink.wren b/test/language/map/grow_and_shrink.wren index a43c9b05..09dd3f34 100644 --- a/test/language/map/grow_and_shrink.wren +++ b/test/language/map/grow_and_shrink.wren @@ -64,13 +64,13 @@ for (fish in fishes) { map[fish] = fish.count } -IO.print(map.count) // expect: 249 +System.print(map.count) // expect: 249 for (n in 0...150) { map.remove(fishes[n]) } -IO.print(map.count) // expect: 99 +System.print(map.count) // expect: 99 // Make sure we can still find all of the remaining ones. var contained = 0 @@ -78,4 +78,4 @@ for (n in 150...249) { if (map.containsKey(fishes[n])) contained = contained + 1 } -IO.print(contained) // expect: 99 +System.print(contained) // expect: 99 diff --git a/test/language/map/newlines.wren b/test/language/map/newlines.wren index c61e81b0..e6d48cb0 100644 --- a/test/language/map/newlines.wren +++ b/test/language/map/newlines.wren @@ -9,19 +9,19 @@ var map = { } -IO.print(map["a"]) // expect: a value -IO.print(map["b"]) // expect: b value +System.print(map["a"]) // expect: a value +System.print(map["b"]) // expect: b value // Newline after trailing comma. map = {"c": "c value", } -IO.print(map["c"]) // expect: c value +System.print(map["c"]) // expect: c value // Newline in empty map. map = { } -IO.print(map.count) // expect: 0 +System.print(map.count) // expect: 0 diff --git a/test/language/map/trailing_comma.wren b/test/language/map/trailing_comma.wren index 7dd0a69f..298f7b02 100644 --- a/test/language/map/trailing_comma.wren +++ b/test/language/map/trailing_comma.wren @@ -3,5 +3,5 @@ var map = { "b": 2, } -IO.print(map["a"]) // expect: 1 -IO.print(map["b"]) // expect: 2 +System.print(map["a"]) // expect: 1 +System.print(map["b"]) // expect: 2 diff --git a/test/language/method/arity.wren b/test/language/method/arity.wren index 987de59f..9501f330 100644 --- a/test/language/method/arity.wren +++ b/test/language/method/arity.wren @@ -21,21 +21,21 @@ class Foo { } var foo = Foo.new() -IO.print(foo.method) // expect: getter -IO.print(foo.method()) // expect: no args -IO.print(foo.method(1)) // expect: 1 -IO.print(foo.method(1, 2)) // expect: 3 -IO.print(foo.method(1, 2, 3)) // expect: 6 -IO.print(foo.method(1, 2, 3, 4)) // expect: 10 -IO.print(foo.method(1, 2, 3, 4, 5)) // expect: 15 -IO.print(foo.method(1, 2, 3, 4, 5, 6)) // expect: 21 -IO.print(foo.method(1, 2, 3, 4, 5, 6, 7)) // expect: 28 -IO.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8)) // expect: 36 -IO.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9)) // expect: 45 -IO.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) // expect: 55 -IO.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) // expect: 66 -IO.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) // expect: 78 -IO.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)) // expect: 91 -IO.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)) // expect: 105 -IO.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) // expect: 120 -IO.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)) // expect: 136 +System.print(foo.method) // expect: getter +System.print(foo.method()) // expect: no args +System.print(foo.method(1)) // expect: 1 +System.print(foo.method(1, 2)) // expect: 3 +System.print(foo.method(1, 2, 3)) // expect: 6 +System.print(foo.method(1, 2, 3, 4)) // expect: 10 +System.print(foo.method(1, 2, 3, 4, 5)) // expect: 15 +System.print(foo.method(1, 2, 3, 4, 5, 6)) // expect: 21 +System.print(foo.method(1, 2, 3, 4, 5, 6, 7)) // expect: 28 +System.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8)) // expect: 36 +System.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9)) // expect: 45 +System.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) // expect: 55 +System.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) // expect: 66 +System.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) // expect: 78 +System.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)) // expect: 91 +System.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)) // expect: 105 +System.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) // expect: 120 +System.print(foo.method(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)) // expect: 136 diff --git a/test/language/method/empty_block.wren b/test/language/method/empty_block.wren index 70dba5ba..e1a75265 100644 --- a/test/language/method/empty_block.wren +++ b/test/language/method/empty_block.wren @@ -3,4 +3,4 @@ class Foo { bar {} } -IO.print(Foo.new().bar) // expect: null +System.print(Foo.new().bar) // expect: null diff --git a/test/language/method/long_name.wren b/test/language/method/long_name.wren index 83cb6e7f..db18373a 100644 --- a/test/language/method/long_name.wren +++ b/test/language/method/long_name.wren @@ -5,4 +5,4 @@ class Foo { } } -IO.print(Foo.new().thisHasAMethodNameThatIsExactly64CharactersLongWhichIsTheMaximum) // expect: result +System.print(Foo.new().thisHasAMethodNameThatIsExactly64CharactersLongWhichIsTheMaximum) // expect: result diff --git a/test/language/method/many_methods.wren b/test/language/method/many_methods.wren index adc69b0b..57994926 100644 --- a/test/language/method/many_methods.wren +++ b/test/language/method/many_methods.wren @@ -2022,4 +2022,4 @@ result = result + foo.method996 result = result + foo.method997 result = result + foo.method998 result = result + foo.method999 -IO.print(result) // expect: 1000 +System.print(result) // expect: 1000 diff --git a/test/language/method/newlines.wren b/test/language/method/newlines.wren index 0f9225e9..33b41def 100644 --- a/test/language/method/newlines.wren +++ b/test/language/method/newlines.wren @@ -7,14 +7,14 @@ class Foo { var foo = Foo.new() // Allow newlines after commas and before ")". -IO.print(foo.method("a", +System.print(foo.method("a", "b" )) // expect: method a b // Allow newlines after commas and before "]". -IO.print(foo["a", +System.print(foo["a", "b" diff --git a/test/language/method/operators.wren b/test/language/method/operators.wren index 53934f51..e36e306f 100644 --- a/test/language/method/operators.wren +++ b/test/language/method/operators.wren @@ -21,19 +21,19 @@ class Foo { } var foo = Foo.new() -IO.print(foo + "a") // expect: infix + a -IO.print(foo - "a") // expect: infix - a -IO.print(foo * "a") // expect: infix * a -IO.print(foo / "a") // expect: infix / a -IO.print(foo % "a") // expect: infix % a -IO.print(foo < "a") // expect: infix < a -IO.print(foo > "a") // expect: infix > a -IO.print(foo <= "a") // expect: infix <= a -IO.print(foo >= "a") // expect: infix >= a -IO.print(foo == "a") // expect: infix == a -IO.print(foo != "a") // expect: infix != a -IO.print(foo & "a") // expect: infix & a -IO.print(foo | "a") // expect: infix | a -IO.print(!foo) // expect: prefix ! -IO.print(~foo) // expect: prefix ~ -IO.print(-foo) // expect: prefix - +System.print(foo + "a") // expect: infix + a +System.print(foo - "a") // expect: infix - a +System.print(foo * "a") // expect: infix * a +System.print(foo / "a") // expect: infix / a +System.print(foo % "a") // expect: infix % a +System.print(foo < "a") // expect: infix < a +System.print(foo > "a") // expect: infix > a +System.print(foo <= "a") // expect: infix <= a +System.print(foo >= "a") // expect: infix >= a +System.print(foo == "a") // expect: infix == a +System.print(foo != "a") // expect: infix != a +System.print(foo & "a") // expect: infix & a +System.print(foo | "a") // expect: infix | a +System.print(!foo) // expect: prefix ! +System.print(~foo) // expect: prefix ~ +System.print(-foo) // expect: prefix - diff --git a/test/language/method/static.wren b/test/language/method/static.wren index bdf4984c..0921779e 100644 --- a/test/language/method/static.wren +++ b/test/language/method/static.wren @@ -7,7 +7,7 @@ class Foo { static bar(arg) { "on metaclass " + arg } } -IO.print(Foo.new().bar) // expect: on instance -IO.print(Foo.bar) // expect: on metaclass -IO.print(Foo.new().bar("arg")) // expect: on instance arg -IO.print(Foo.bar("arg")) // expect: on metaclass arg +System.print(Foo.new().bar) // expect: on instance +System.print(Foo.bar) // expect: on metaclass +System.print(Foo.new().bar("arg")) // expect: on instance arg +System.print(Foo.bar("arg")) // expect: on metaclass arg diff --git a/test/language/method/subscript_operators.wren b/test/language/method/subscript_operators.wren index 57b6d4df..6ce5c1b4 100644 --- a/test/language/method/subscript_operators.wren +++ b/test/language/method/subscript_operators.wren @@ -9,9 +9,9 @@ class Foo { } var foo = Foo.new() -IO.print(foo["a"]) // expect: 1-subscript a -IO.print(foo["a", "b"]) // expect: 2-subscript a b -IO.print(foo["a", "b", "c"]) // expect: 3-subscript a b c -IO.print(foo["a"] = "value") // expect: 1-subscript setter a = value -IO.print(foo["a", "b"] = "value") // expect: 2-subscript setter a b = value -IO.print(foo["a", "b", "c"] = "value") // expect: 3-subscript setter a b c = value +System.print(foo["a"]) // expect: 1-subscript a +System.print(foo["a", "b"]) // expect: 2-subscript a b +System.print(foo["a", "b", "c"]) // expect: 3-subscript a b c +System.print(foo["a"] = "value") // expect: 1-subscript setter a = value +System.print(foo["a", "b"] = "value") // expect: 2-subscript setter a b = value +System.print(foo["a", "b", "c"] = "value") // expect: 3-subscript setter a b c = value diff --git a/test/language/method/too_many_arguments.wren b/test/language/method/too_many_arguments.wren index c49643b8..e49c76ba 100644 --- a/test/language/method/too_many_arguments.wren +++ b/test/language/method/too_many_arguments.wren @@ -1 +1 @@ -IO.print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17) // expect error +System.print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17) // expect error diff --git a/test/language/module/change_imported_value/change_imported_value.wren b/test/language/module/change_imported_value/change_imported_value.wren index c5163410..0f5aa0ff 100644 --- a/test/language/module/change_imported_value/change_imported_value.wren +++ b/test/language/module/change_imported_value/change_imported_value.wren @@ -1,11 +1,11 @@ import "module" for Module, Other -IO.print(Module) // expect: before +System.print(Module) // expect: before // Reassigning the variable in the other module does not affect this one's // binding. Other.change -IO.print(Module) // expect: before +System.print(Module) // expect: before // But it does change there. Other.show // expect: after diff --git a/test/language/module/change_imported_value/module.wren b/test/language/module/change_imported_value/module.wren index fac9ddc9..8a6f9986 100644 --- a/test/language/module/change_imported_value/module.wren +++ b/test/language/module/change_imported_value/module.wren @@ -7,6 +7,6 @@ class Other { } static show { - IO.print(Module) + System.print(Module) } } diff --git a/test/language/module/cyclic_import/a.wren b/test/language/module/cyclic_import/a.wren index 08000a19..54e0a80d 100644 --- a/test/language/module/cyclic_import/a.wren +++ b/test/language/module/cyclic_import/a.wren @@ -1,9 +1,9 @@ // nontest -IO.print("start a") +System.print("start a") var A = "a value" -IO.print("a defined ", A) +System.print("a defined " + A) import "b" for B -IO.print("a imported ", B) +System.print("a imported " + B) -IO.print("end a") \ No newline at end of file +System.print("end a") \ No newline at end of file diff --git a/test/language/module/cyclic_import/b.wren b/test/language/module/cyclic_import/b.wren index 3b049a50..3671f9d5 100644 --- a/test/language/module/cyclic_import/b.wren +++ b/test/language/module/cyclic_import/b.wren @@ -1,9 +1,9 @@ // nontest -IO.print("start b") +System.print("start b") var B = "b value" -IO.print("b defined ", B) +System.print("b defined " + B) import "a" for A -IO.print("b imported ", A) +System.print("b imported " + A) -IO.print("end b") +System.print("end b") diff --git a/test/language/module/implicitly_imports_core/module.wren b/test/language/module/implicitly_imports_core/module.wren index bd444960..3f592932 100644 --- a/test/language/module/implicitly_imports_core/module.wren +++ b/test/language/module/implicitly_imports_core/module.wren @@ -1,15 +1,15 @@ // nontest -IO.print(Bool) -IO.print(Class) -IO.print(Fiber) -IO.print(Fn) -IO.print(List) -IO.print(Map) -IO.print(MapKeySequence) -IO.print(MapValueSequence) -IO.print(Null) -IO.print(Num) -IO.print(Object) -IO.print(Range) -IO.print(Sequence) -IO.print(String) +System.print(Bool) +System.print(Class) +System.print(Fiber) +System.print(Fn) +System.print(List) +System.print(Map) +System.print(MapKeySequence) +System.print(MapValueSequence) +System.print(Null) +System.print(Num) +System.print(Object) +System.print(Range) +System.print(Sequence) +System.print(String) diff --git a/test/language/module/inside_block/inside_block.wren b/test/language/module/inside_block/inside_block.wren index d15d27d9..f19bc0c7 100644 --- a/test/language/module/inside_block/inside_block.wren +++ b/test/language/module/inside_block/inside_block.wren @@ -4,7 +4,7 @@ if (true) { import "module" for Module // expect: ran module - IO.print(Module) // expect: from module + System.print(Module) // expect: from module } -IO.print(Module) // expect: outer +System.print(Module) // expect: outer diff --git a/test/language/module/inside_block/module.wren b/test/language/module/inside_block/module.wren index cf2ce362..a1289a13 100644 --- a/test/language/module/inside_block/module.wren +++ b/test/language/module/inside_block/module.wren @@ -1,3 +1,3 @@ // nontest var Module = "from module" -IO.print("ran module") +System.print("ran module") diff --git a/test/language/module/module_dir/module_dir.wren b/test/language/module/module_dir/module_dir.wren index a19d6ade..e2867d02 100644 --- a/test/language/module/module_dir/module_dir.wren +++ b/test/language/module/module_dir/module_dir.wren @@ -1,3 +1,3 @@ import "something" for Index -IO.print(Index) // expect: index \ No newline at end of file +System.print(Index) // expect: index \ No newline at end of file diff --git a/test/language/module/multiple_variables/module.wren b/test/language/module/multiple_variables/module.wren index ed5932ca..85a562f7 100644 --- a/test/language/module/multiple_variables/module.wren +++ b/test/language/module/multiple_variables/module.wren @@ -5,4 +5,4 @@ var Module3 = "from module three" var Module4 = "from module four" var Module5 = "from module five" -IO.print("ran module") +System.print("ran module") diff --git a/test/language/module/multiple_variables/multiple_variables.wren b/test/language/module/multiple_variables/multiple_variables.wren index 7d007604..abf387c6 100644 --- a/test/language/module/multiple_variables/multiple_variables.wren +++ b/test/language/module/multiple_variables/multiple_variables.wren @@ -3,8 +3,8 @@ import "module" for Module1, Module2, Module3, Module4, Module5 // Only execute module body once: // expect: ran module -IO.print(Module1) // expect: from module one -IO.print(Module2) // expect: from module two -IO.print(Module3) // expect: from module three -IO.print(Module4) // expect: from module four -IO.print(Module5) // expect: from module five +System.print(Module1) // expect: from module one +System.print(Module2) // expect: from module two +System.print(Module3) // expect: from module three +System.print(Module4) // expect: from module four +System.print(Module5) // expect: from module five diff --git a/test/language/module/no_variable/module.wren b/test/language/module/no_variable/module.wren index c1acca4a..e761fd73 100644 --- a/test/language/module/no_variable/module.wren +++ b/test/language/module/no_variable/module.wren @@ -1,2 +1,2 @@ // nontest -IO.print("ran module") +System.print("ran module") diff --git a/test/language/module/shared_import/a.wren b/test/language/module/shared_import/a.wren index 658a34d3..96dd90a2 100644 --- a/test/language/module/shared_import/a.wren +++ b/test/language/module/shared_import/a.wren @@ -1,5 +1,5 @@ // nontest -IO.print("a") +System.print("a") import "shared" for Shared var A = "a " + Shared -IO.print("a done") +System.print("a done") diff --git a/test/language/module/shared_import/b.wren b/test/language/module/shared_import/b.wren index 63753be1..7dd9f4ab 100644 --- a/test/language/module/shared_import/b.wren +++ b/test/language/module/shared_import/b.wren @@ -1,5 +1,5 @@ // nontest -IO.print("b") +System.print("b") import "shared" for Shared var B = "b " + Shared -IO.print("b done") +System.print("b done") diff --git a/test/language/module/shared_import/shared.wren b/test/language/module/shared_import/shared.wren index cd67246c..e8250cd0 100644 --- a/test/language/module/shared_import/shared.wren +++ b/test/language/module/shared_import/shared.wren @@ -1,3 +1,3 @@ // nontest -IO.print("shared") +System.print("shared") var Shared = "shared" diff --git a/test/language/module/shared_import/shared_import.wren b/test/language/module/shared_import/shared_import.wren index 0ff45b30..970cfe62 100644 --- a/test/language/module/shared_import/shared_import.wren +++ b/test/language/module/shared_import/shared_import.wren @@ -8,5 +8,5 @@ import "b" for B // expect: b // expect: b done -IO.print(A) // expect: a shared -IO.print(B) // expect: b shared +System.print(A) // expect: a shared +System.print(B) // expect: b shared diff --git a/test/language/module/simple_import/module.wren b/test/language/module/simple_import/module.wren index cf2ce362..a1289a13 100644 --- a/test/language/module/simple_import/module.wren +++ b/test/language/module/simple_import/module.wren @@ -1,3 +1,3 @@ // nontest var Module = "from module" -IO.print("ran module") +System.print("ran module") diff --git a/test/language/module/simple_import/simple_import.wren b/test/language/module/simple_import/simple_import.wren index aae635ec..eb46932b 100644 --- a/test/language/module/simple_import/simple_import.wren +++ b/test/language/module/simple_import/simple_import.wren @@ -1,4 +1,4 @@ import "module" for Module // expect: ran module -IO.print(Module) // expect: from module +System.print(Module) // expect: from module diff --git a/test/language/module/unknown_variable/module.wren b/test/language/module/unknown_variable/module.wren index cf2ce362..a1289a13 100644 --- a/test/language/module/unknown_variable/module.wren +++ b/test/language/module/unknown_variable/module.wren @@ -1,3 +1,3 @@ // nontest var Module = "from module" -IO.print("ran module") +System.print("ran module") diff --git a/test/language/no_trailing_newline.wren b/test/language/no_trailing_newline.wren index 0b7bfa9e..c44c2d41 100644 --- a/test/language/no_trailing_newline.wren +++ b/test/language/no_trailing_newline.wren @@ -1 +1 @@ -IO.print("ok") // expect: ok \ No newline at end of file +System.print("ok") // expect: ok \ No newline at end of file diff --git a/test/language/nonlocal/assignment.wren b/test/language/nonlocal/assignment.wren index 90fd6223..fb05caf6 100644 --- a/test/language/nonlocal/assignment.wren +++ b/test/language/nonlocal/assignment.wren @@ -1,7 +1,7 @@ var Nonlocal = "before" -IO.print(Nonlocal) // expect: before +System.print(Nonlocal) // expect: before Nonlocal = "after" -IO.print(Nonlocal) // expect: after +System.print(Nonlocal) // expect: after class Foo { static method { @@ -10,9 +10,9 @@ class Foo { } Foo.method -IO.print(Nonlocal) // expect: method +System.print(Nonlocal) // expect: method Fn.new { Nonlocal = "fn" }.call() -IO.print(Nonlocal) // expect: fn +System.print(Nonlocal) // expect: fn diff --git a/test/language/nonlocal/in_block_scope.wren b/test/language/nonlocal/in_block_scope.wren index 2c0ea96b..b8c3bbe3 100644 --- a/test/language/nonlocal/in_block_scope.wren +++ b/test/language/nonlocal/in_block_scope.wren @@ -2,7 +2,7 @@ var Nonlocal = "outer" { var Nonlocal = "inner" - IO.print(Nonlocal) // expect: inner + System.print(Nonlocal) // expect: inner } -IO.print(Nonlocal) // expect: outer +System.print(Nonlocal) // expect: outer diff --git a/test/language/nonlocal/mutual_recursion.wren b/test/language/nonlocal/mutual_recursion.wren index a0c9e65e..0eaf4948 100644 --- a/test/language/nonlocal/mutual_recursion.wren +++ b/test/language/nonlocal/mutual_recursion.wren @@ -8,5 +8,5 @@ class Bar { static foo { Foo.new() } } -IO.print(Foo.bar) // expect: instance of Bar -IO.print(Bar.foo) // expect: instance of Foo +System.print(Foo.bar) // expect: instance of Bar +System.print(Bar.foo) // expect: instance of Foo diff --git a/test/language/nonlocal/nonlocal_in_initializer.wren b/test/language/nonlocal/nonlocal_in_initializer.wren index 3faacdd8..6de6f473 100644 --- a/test/language/nonlocal/nonlocal_in_initializer.wren +++ b/test/language/nonlocal/nonlocal_in_initializer.wren @@ -1,2 +1,2 @@ var A = A == null -IO.print(A) // expect: true +System.print(A) // expect: true diff --git a/test/language/nonlocal/nonlocal_without_initializer.wren b/test/language/nonlocal/nonlocal_without_initializer.wren index 2a08b8c9..5382e0d7 100644 --- a/test/language/nonlocal/nonlocal_without_initializer.wren +++ b/test/language/nonlocal/nonlocal_without_initializer.wren @@ -1,2 +1,2 @@ var A -IO.print(A) // expect: null +System.print(A) // expect: null diff --git a/test/language/nonlocal/null_before_defined.wren b/test/language/nonlocal/null_before_defined.wren index f76f0536..5511db74 100644 --- a/test/language/nonlocal/null_before_defined.wren +++ b/test/language/nonlocal/null_before_defined.wren @@ -1,3 +1,3 @@ -IO.print(Foo) // expect: null +System.print(Foo) // expect: null var Foo = "value" -IO.print(Foo) // expect: value +System.print(Foo) // expect: value diff --git a/test/language/nonlocal/undefined.wren b/test/language/nonlocal/undefined.wren index 7fab4f29..2ff78950 100644 --- a/test/language/nonlocal/undefined.wren +++ b/test/language/nonlocal/undefined.wren @@ -1,6 +1,6 @@ var fn = Fn.new { - IO.print(Foo) - IO.print(Bar) + System.print(Foo) + System.print(Bar) } // expect error line 6 \ No newline at end of file diff --git a/test/language/nonlocal/use_in_function.wren b/test/language/nonlocal/use_in_function.wren index 657eeef2..cc1867cd 100644 --- a/test/language/nonlocal/use_in_function.wren +++ b/test/language/nonlocal/use_in_function.wren @@ -1,5 +1,5 @@ var Global = "global" Fn.new { - IO.print(Global) // expect: global + System.print(Global) // expect: global }.call() diff --git a/test/language/nonlocal/use_in_function_before_definition.wren b/test/language/nonlocal/use_in_function_before_definition.wren index 1a797cc2..4c2934b3 100644 --- a/test/language/nonlocal/use_in_function_before_definition.wren +++ b/test/language/nonlocal/use_in_function_before_definition.wren @@ -1,5 +1,5 @@ var f = Fn.new { - IO.print(Global) + System.print(Global) } var Global = "global" diff --git a/test/language/nonlocal/use_in_method.wren b/test/language/nonlocal/use_in_method.wren index 91945fa9..5d620e99 100644 --- a/test/language/nonlocal/use_in_method.wren +++ b/test/language/nonlocal/use_in_method.wren @@ -4,11 +4,11 @@ class Foo { construct new() {} method { - IO.print(Global) + System.print(Global) } static classMethod { - IO.print(Global) + System.print(Global) } } diff --git a/test/language/nonlocal/use_in_method_before_definition.wren b/test/language/nonlocal/use_in_method_before_definition.wren index 81f27b38..0498901b 100644 --- a/test/language/nonlocal/use_in_method_before_definition.wren +++ b/test/language/nonlocal/use_in_method_before_definition.wren @@ -2,11 +2,11 @@ class Foo { construct new() {} method { - IO.print(Global) + System.print(Global) } static classMethod { - IO.print(Global) + System.print(Global) } } diff --git a/test/language/null/literal.wren b/test/language/null/literal.wren index 8f59128c..b83dbc65 100644 --- a/test/language/null/literal.wren +++ b/test/language/null/literal.wren @@ -1 +1 @@ -IO.print(null) // expect: null +System.print(null) // expect: null diff --git a/test/language/number/hex_literals.wren b/test/language/number/hex_literals.wren index 7a88fa5e..5a63d96d 100644 --- a/test/language/number/hex_literals.wren +++ b/test/language/number/hex_literals.wren @@ -1,8 +1,8 @@ var x = 0xFF -IO.print(x) // expect: 255 -IO.print(x + 1) // expect: 256 -IO.print(x == 255) // expect: true -IO.print(0x09 is Num) // expect: true -IO.print(x is Num) // expect: true -IO.print(-0xFF) // expect: -255 \ No newline at end of file +System.print(x) // expect: 255 +System.print(x + 1) // expect: 256 +System.print(x == 255) // expect: true +System.print(0x09 is Num) // expect: true +System.print(x is Num) // expect: true +System.print(-0xFF) // expect: -255 \ No newline at end of file diff --git a/test/language/number/literals.wren b/test/language/number/literals.wren index 63f36e70..edf3f157 100644 --- a/test/language/number/literals.wren +++ b/test/language/number/literals.wren @@ -1,9 +1,9 @@ -IO.print(123) // expect: 123 -IO.print(987654) // expect: 987654 -IO.print(0) // expect: 0 -IO.print(-0) // expect: -0 +System.print(123) // expect: 123 +System.print(987654) // expect: 987654 +System.print(0) // expect: 0 +System.print(-0) // expect: -0 -IO.print(123.456) // expect: 123.456 -IO.print(-0.001) // expect: -0.001 +System.print(123.456) // expect: 123.456 +System.print(-0.001) // expect: -0.001 // TODO: Literals at and beyond numeric limits. diff --git a/test/language/number/scientific_literals.wren b/test/language/number/scientific_literals.wren index 11024743..52695068 100644 --- a/test/language/number/scientific_literals.wren +++ b/test/language/number/scientific_literals.wren @@ -1,9 +1,9 @@ var x = 2.55e2 -IO.print(x) // expect: 255 -IO.print(x + 1) // expect: 256 -IO.print(x == 255) // expect: true -IO.print(2.55e-2 is Num) // expect: true -IO.print(x is Num) // expect: true -IO.print(-2.55e2) // expect: -255 -IO.print(-25500e-2) // expect: -255 +System.print(x) // expect: 255 +System.print(x + 1) // expect: 256 +System.print(x == 255) // expect: true +System.print(2.55e-2 is Num) // expect: true +System.print(x is Num) // expect: true +System.print(-2.55e2) // expect: -255 +System.print(-25500e-2) // expect: -255 diff --git a/test/language/precedence.wren b/test/language/precedence.wren index e14b110c..db9bbc1f 100644 --- a/test/language/precedence.wren +++ b/test/language/precedence.wren @@ -1,41 +1,41 @@ // * has higher precedence than +. -IO.print(2 + 3 * 4) // expect: 14 +System.print(2 + 3 * 4) // expect: 14 // * has higher precedence than -. -IO.print(20 - 3 * 4) // expect: 8 +System.print(20 - 3 * 4) // expect: 8 // / has higher precedence than +. -IO.print(2 + 6 / 3) // expect: 4 +System.print(2 + 6 / 3) // expect: 4 // / has higher precedence than -. -IO.print(2 - 6 / 3) // expect: 0 +System.print(2 - 6 / 3) // expect: 0 // < has higher precedence than ==. -IO.print(false == 2 < 1) // expect: true +System.print(false == 2 < 1) // expect: true // > has higher precedence than ==. -IO.print(false == 1 > 2) // expect: true +System.print(false == 1 > 2) // expect: true // <= has higher precedence than ==. -IO.print(false == 2 <= 1) // expect: true +System.print(false == 2 <= 1) // expect: true // >= has higher precedence than ==. -IO.print(false == 1 >= 2) // expect: true +System.print(false == 1 >= 2) // expect: true // is has higher precedence than ==. -IO.print(true == 10 is Num) // expect: true -IO.print(10 is Num == false) // expect: false +System.print(true == 10 is Num) // expect: true +System.print(10 is Num == false) // expect: false // Unary - has lower precedence than .. -IO.print(-"abc".count) // expect: -3 +System.print(-"abc".count) // expect: -3 // 1 - 1 is not space-sensitive. -IO.print(1 - 1) // expect: 0 -IO.print(1 -1) // expect: 0 -IO.print(1- 1) // expect: 0 -IO.print(1-1) // expect: 0 +System.print(1 - 1) // expect: 0 +System.print(1 -1) // expect: 0 +System.print(1- 1) // expect: 0 +System.print(1-1) // expect: 0 // TODO: %, associativity. // Using () for grouping. -IO.print((2 * (6 - (2 + 2)))) // expect: 4 +System.print((2 * (6 - (2 + 2)))) // expect: 4 diff --git a/test/language/return/after_else.wren b/test/language/return/after_else.wren index 58ca87fe..f6c87559 100644 --- a/test/language/return/after_else.wren +++ b/test/language/return/after_else.wren @@ -1,3 +1,3 @@ -IO.print(Fn.new { +System.print(Fn.new { if (false) "no" else return "ok" }.call()) // expect: ok diff --git a/test/language/return/after_if.wren b/test/language/return/after_if.wren index cd57363b..9d18c640 100644 --- a/test/language/return/after_if.wren +++ b/test/language/return/after_if.wren @@ -1,3 +1,3 @@ -IO.print(Fn.new { +System.print(Fn.new { if (true) return "ok" }.call()) // expect: ok diff --git a/test/language/return/after_while.wren b/test/language/return/after_while.wren index 4f09fb3b..73800605 100644 --- a/test/language/return/after_while.wren +++ b/test/language/return/after_while.wren @@ -1,3 +1,3 @@ -IO.print(Fn.new { +System.print(Fn.new { while (true) return "ok" }.call()) // expect: ok diff --git a/test/language/return/in_function.wren b/test/language/return/in_function.wren index 9b031b7e..42b6cfc0 100644 --- a/test/language/return/in_function.wren +++ b/test/language/return/in_function.wren @@ -1,6 +1,6 @@ var f = Fn.new { return "ok" - IO.print("bad") + System.print("bad") } -IO.print(f.call()) // expect: ok +System.print(f.call()) // expect: ok diff --git a/test/language/return/in_method.wren b/test/language/return/in_method.wren index eeee1f38..485480d4 100644 --- a/test/language/return/in_method.wren +++ b/test/language/return/in_method.wren @@ -3,8 +3,8 @@ class Foo { method { return "ok" - IO.print("bad") + System.print("bad") } } -IO.print(Foo.new().method) // expect: ok +System.print(Foo.new().method) // expect: ok diff --git a/test/language/return/return_null_if_newline.wren b/test/language/return/return_null_if_newline.wren index d206dbe1..0afc88c3 100644 --- a/test/language/return/return_null_if_newline.wren +++ b/test/language/return/return_null_if_newline.wren @@ -1,6 +1,6 @@ var f = Fn.new { return - IO.print("bad") + System.print("bad") } -IO.print(f.call()) // expect: null +System.print(f.call()) // expect: null diff --git a/test/language/semicolon.wren b/test/language/semicolon.wren index 7a5a8bfe..a7bd49f2 100644 --- a/test/language/semicolon.wren +++ b/test/language/semicolon.wren @@ -1,2 +1,2 @@ // Semicolons are not valid separators. -var a = "ok"; IO.print(a) // expect error +var a = "ok"; System.print(a) // expect error diff --git a/test/language/setter/associativity.wren b/test/language/setter/associativity.wren index 4693502f..62cde71f 100644 --- a/test/language/setter/associativity.wren +++ b/test/language/setter/associativity.wren @@ -13,6 +13,6 @@ var c = Foo.new("c") // Assignment is right-associative. a.bar = b.bar = c.bar = "d" -IO.print(a.toString) // expect: d -IO.print(b.toString) // expect: d -IO.print(c.toString) // expect: d +System.print(a.toString) // expect: d +System.print(b.toString) // expect: d +System.print(c.toString) // expect: d diff --git a/test/language/setter/instance.wren b/test/language/setter/instance.wren index 05362131..b9688cca 100644 --- a/test/language/setter/instance.wren +++ b/test/language/setter/instance.wren @@ -2,7 +2,7 @@ class Foo { construct new() {} bar=(value) { - IO.print(value) + System.print(value) } } diff --git a/test/language/setter/result.wren b/test/language/setter/result.wren index dbc315c4..cd14d263 100644 --- a/test/language/setter/result.wren +++ b/test/language/setter/result.wren @@ -4,4 +4,4 @@ class Foo { } var foo = Foo.new() -IO.print(foo.bar = "value") // expect: result +System.print(foo.bar = "value") // expect: result diff --git a/test/language/setter/same_name_as_method.wren b/test/language/setter/same_name_as_method.wren index c6b34cc4..d4d7880d 100644 --- a/test/language/setter/same_name_as_method.wren +++ b/test/language/setter/same_name_as_method.wren @@ -1,7 +1,7 @@ class Foo { construct new() {} - bar=(value) { IO.print("set") } - bar { IO.print("get") } + bar=(value) { System.print("set") } + bar { System.print("get") } } var foo = Foo.new() diff --git a/test/language/setter/static.wren b/test/language/setter/static.wren index e0c3850b..e3dcf875 100644 --- a/test/language/setter/static.wren +++ b/test/language/setter/static.wren @@ -1,6 +1,6 @@ class Foo { static bar=(value) { - IO.print(value) + System.print(value) } } diff --git a/test/language/shebang/shebang.wren b/test/language/shebang/shebang.wren index 83f35c0a..e6bd8691 100644 --- a/test/language/shebang/shebang.wren +++ b/test/language/shebang/shebang.wren @@ -1,2 +1,2 @@ #!/bin/wren -IO.print("ok") // expect: ok +System.print("ok") // expect: ok diff --git a/test/language/shebang/shebang_at_other_line.wren b/test/language/shebang/shebang_at_other_line.wren index 4fa3ac95..ee5234f8 100644 --- a/test/language/shebang/shebang_at_other_line.wren +++ b/test/language/shebang/shebang_at_other_line.wren @@ -1,3 +1,3 @@ // expect error line 3 -IO.print("nope") +System.print("nope") #!/bin/wren \ No newline at end of file diff --git a/test/language/shebang/shebang_invalid.wren b/test/language/shebang/shebang_invalid.wren index 828c4fa0..3890ebe1 100644 --- a/test/language/shebang/shebang_invalid.wren +++ b/test/language/shebang/shebang_invalid.wren @@ -1,3 +1,3 @@ #/invalid/shebang // expect error line 1 -IO.print("nope") +System.print("nope") diff --git a/test/language/static_field/closure.wren b/test/language/static_field/closure.wren index 46e7d5b5..ecabd61e 100644 --- a/test/language/static_field/closure.wren +++ b/test/language/static_field/closure.wren @@ -11,6 +11,6 @@ class Foo { } Foo.initialize -IO.print(Foo.closeOverGet.call()) // expect: Foo field +System.print(Foo.closeOverGet.call()) // expect: Foo field Foo.closeOverSet.call() -IO.print(Foo.closeOverGet.call()) // expect: new value +System.print(Foo.closeOverGet.call()) // expect: new value diff --git a/test/language/static_field/default_to_null.wren b/test/language/static_field/default_to_null.wren index d5b06d2c..1832e7d3 100644 --- a/test/language/static_field/default_to_null.wren +++ b/test/language/static_field/default_to_null.wren @@ -1,5 +1,5 @@ class Foo { - static write { IO.print(__field) } + static write { System.print(__field) } } Foo.write // expect: null diff --git a/test/language/static_field/in_instance_method.wren b/test/language/static_field/in_instance_method.wren index bb00412e..554dc59e 100644 --- a/test/language/static_field/in_instance_method.wren +++ b/test/language/static_field/in_instance_method.wren @@ -10,11 +10,11 @@ class Foo { } write() { - IO.print(__a) - IO.print(__b) - IO.print(__c) - IO.print(__d) - IO.print(__e) + System.print(__a) + System.print(__b) + System.print(__c) + System.print(__d) + System.print(__e) } } diff --git a/test/language/static_field/multiple.wren b/test/language/static_field/multiple.wren index f6b077b0..92934810 100644 --- a/test/language/static_field/multiple.wren +++ b/test/language/static_field/multiple.wren @@ -8,11 +8,11 @@ class Foo { } static write { - IO.print(__a) - IO.print(__b) - IO.print(__c) - IO.print(__d) - IO.print(__e) + System.print(__a) + System.print(__b) + System.print(__c) + System.print(__d) + System.print(__e) } } diff --git a/test/language/static_field/nested_class.wren b/test/language/static_field/nested_class.wren index 8e1ce892..df1c6d3d 100644 --- a/test/language/static_field/nested_class.wren +++ b/test/language/static_field/nested_class.wren @@ -3,36 +3,36 @@ class Outer { static staticMethod { __field = "outer" - IO.print(__field) // expect: outer + System.print(__field) // expect: outer class Inner { construct new() {} static staticMethod { __field = "inner" - IO.print(__field) // expect: inner + System.print(__field) // expect: inner } } Inner.staticMethod - IO.print(__field) // expect: outer + System.print(__field) // expect: outer } instanceMethod { __field = "outer" - IO.print(__field) // expect: outer + System.print(__field) // expect: outer class Inner { construct new() {} instanceMethod { __field = "inner" - IO.print(__field) // expect: inner + System.print(__field) // expect: inner } } Inner.new().instanceMethod - IO.print(__field) // expect: outer + System.print(__field) // expect: outer } } diff --git a/test/language/static_field/use_before_set.wren b/test/language/static_field/use_before_set.wren index 1daeaa89..d2cfa1fc 100644 --- a/test/language/static_field/use_before_set.wren +++ b/test/language/static_field/use_before_set.wren @@ -1,5 +1,5 @@ class Foo { - static write { IO.print(__field) } // Compile a use of the field... + static write { System.print(__field) } // Compile a use of the field... static init { __field = "value" } // ...before an assignment to it. } diff --git a/test/language/string/byte_escapes.wren b/test/language/string/byte_escapes.wren index 9d29d148..0d26e699 100644 --- a/test/language/string/byte_escapes.wren +++ b/test/language/string/byte_escapes.wren @@ -1,12 +1,12 @@ var bytes = "\x00\x12\x34\x56\x78\xab\xCD\xfFf".bytes -IO.print(bytes[0]) // expect: 0 -IO.print(bytes[1]) // expect: 18 -IO.print(bytes[2]) // expect: 52 -IO.print(bytes[3]) // expect: 86 -IO.print(bytes[4]) // expect: 120 -IO.print(bytes[5]) // expect: 171 -IO.print(bytes[6]) // expect: 205 -IO.print(bytes[7]) // expect: 255 +System.print(bytes[0]) // expect: 0 +System.print(bytes[1]) // expect: 18 +System.print(bytes[2]) // expect: 52 +System.print(bytes[3]) // expect: 86 +System.print(bytes[4]) // expect: 120 +System.print(bytes[5]) // expect: 171 +System.print(bytes[6]) // expect: 205 +System.print(bytes[7]) // expect: 255 // "f". -IO.print(bytes[8]) // expect: 102 +System.print(bytes[8]) // expect: 102 diff --git a/test/language/string/escapes.wren b/test/language/string/escapes.wren index eaf5ab75..70628b45 100644 --- a/test/language/string/escapes.wren +++ b/test/language/string/escapes.wren @@ -1,7 +1,7 @@ // Escape characters. -IO.print("\"") // expect: " -IO.print("\\") // expect: \ -IO.print("(\n)") // expect: ( +System.print("\"") // expect: " +System.print("\\") // expect: \ +System.print("(\n)") // expect: ( // expect: ) // TODO: Non-printing escapes like \t. diff --git a/test/language/string/literals.wren b/test/language/string/literals.wren index 870d3f89..a51124f9 100644 --- a/test/language/string/literals.wren +++ b/test/language/string/literals.wren @@ -1,5 +1,5 @@ -IO.print("".count) // expect: 0 -IO.print("a string") // expect: a string +System.print("".count) // expect: 0 +System.print("a string") // expect: a string // Non-ASCII. -IO.print("A~¶Þॐஃ") // expect: A~¶Þॐஃ +System.print("A~¶Þॐஃ") // expect: A~¶Þॐஃ diff --git a/test/language/string/unicode_escapes.wren b/test/language/string/unicode_escapes.wren index e15c4447..786cefe4 100644 --- a/test/language/string/unicode_escapes.wren +++ b/test/language/string/unicode_escapes.wren @@ -1,17 +1,17 @@ // One byte UTF-8 Sequences. -IO.print("\u0041") // expect: A -IO.print("\u007e") // expect: ~ +System.print("\u0041") // expect: A +System.print("\u007e") // expect: ~ // Two byte sequences. -IO.print("\u00b6") // expect: ¶ -IO.print("\u00de") // expect: Þ +System.print("\u00b6") // expect: ¶ +System.print("\u00de") // expect: Þ // Three byte sequences. -IO.print("\u0950") // expect: ॐ -IO.print("\u0b83") // expect: ஃ +System.print("\u0950") // expect: ॐ +System.print("\u0b83") // expect: ஃ // Capitalized hex. -IO.print("\u00B6") // expect: ¶ -IO.print("\u00DE") // expect: Þ +System.print("\u00B6") // expect: ¶ +System.print("\u00DE") // expect: Þ // TODO: Syntax for Unicode escapes > 0xffff? diff --git a/test/language/super/call_different_arity.wren b/test/language/super/call_different_arity.wren index 03edb94f..58fb8ab7 100644 --- a/test/language/super/call_different_arity.wren +++ b/test/language/super/call_different_arity.wren @@ -1,14 +1,14 @@ class Base { - foo { IO.print("Base.foo") } - foo(a) { IO.print("Base.foo(a)") } - foo(a, b) { IO.print("Base.foo(a, b)") } + foo { System.print("Base.foo") } + foo(a) { System.print("Base.foo(a)") } + foo(a, b) { System.print("Base.foo(a, b)") } } class Derived is Base { construct new() {} foo(a) { - IO.print("Derived.bar(a)") + System.print("Derived.bar(a)") super super(1) super(1, 2) diff --git a/test/language/super/call_other_method.wren b/test/language/super/call_other_method.wren index e048ac5b..35a6d512 100644 --- a/test/language/super/call_other_method.wren +++ b/test/language/super/call_other_method.wren @@ -1,6 +1,6 @@ class Base { foo { - IO.print("Base.foo") + System.print("Base.foo") } } @@ -8,7 +8,7 @@ class Derived is Base { construct new() {} bar { - IO.print("Derived.bar") + System.print("Derived.bar") super.foo } } diff --git a/test/language/super/call_same_method.wren b/test/language/super/call_same_method.wren index a70d60bf..07a08c57 100644 --- a/test/language/super/call_same_method.wren +++ b/test/language/super/call_same_method.wren @@ -1,6 +1,6 @@ class Base { foo { - IO.print("Base.foo") + System.print("Base.foo") } } @@ -8,7 +8,7 @@ class Derived is Base { construct new() {} foo { - IO.print("Derived.foo") + System.print("Derived.foo") super.foo } } diff --git a/test/language/super/closure.wren b/test/language/super/closure.wren index b1302467..83b53df4 100644 --- a/test/language/super/closure.wren +++ b/test/language/super/closure.wren @@ -9,4 +9,4 @@ class Derived is Base { } var closure = Derived.new().getClosure -IO.print(closure.call()) // expect: Base +System.print(closure.call()) // expect: Base diff --git a/test/language/super/implicit_name.wren b/test/language/super/implicit_name.wren index 75100560..ee73ff1e 100644 --- a/test/language/super/implicit_name.wren +++ b/test/language/super/implicit_name.wren @@ -1,6 +1,6 @@ class Base { foo { - IO.print("Base.foo") + System.print("Base.foo") } } @@ -8,7 +8,7 @@ class Derived is Base { construct new() {} foo { - IO.print("Derived.foo") + System.print("Derived.foo") super } } diff --git a/test/language/super/indirectly_inherited.wren b/test/language/super/indirectly_inherited.wren index 765459b8..a754fdf5 100644 --- a/test/language/super/indirectly_inherited.wren +++ b/test/language/super/indirectly_inherited.wren @@ -1,6 +1,6 @@ class A { foo { - IO.print("A.foo") + System.print("A.foo") } } @@ -10,7 +10,7 @@ class C is B { construct new() {} foo { - IO.print("C.foo") + System.print("C.foo") super.foo } } diff --git a/test/language/super/super_in_closure_in_inherited_method.wren b/test/language/super/super_in_closure_in_inherited_method.wren index ef97d602..de712455 100644 --- a/test/language/super/super_in_closure_in_inherited_method.wren +++ b/test/language/super/super_in_closure_in_inherited_method.wren @@ -10,4 +10,4 @@ class B is A { construct new() {} } -IO.print(B.new().callSuperToString) // expect: instance of B +System.print(B.new().callSuperToString) // expect: instance of B diff --git a/test/language/super/super_in_inherited_method.wren b/test/language/super/super_in_inherited_method.wren index 1a7e914d..cab2f762 100644 --- a/test/language/super/super_in_inherited_method.wren +++ b/test/language/super/super_in_inherited_method.wren @@ -8,4 +8,4 @@ class B is A { construct new() {} } -IO.print(B.new().callSuperToString) // expect: instance of B +System.print(B.new().callSuperToString) // expect: instance of B diff --git a/test/language/this/closure.wren b/test/language/this/closure.wren index d254b371..60d49a58 100644 --- a/test/language/this/closure.wren +++ b/test/language/this/closure.wren @@ -5,4 +5,4 @@ class Foo { } var closure = Foo.new().getClosure -IO.print(closure.call()) // expect: Foo +System.print(closure.call()) // expect: Foo diff --git a/test/language/this/nested_class.wren b/test/language/this/nested_class.wren index f7c5351f..3b207422 100644 --- a/test/language/this/nested_class.wren +++ b/test/language/this/nested_class.wren @@ -2,16 +2,16 @@ class Outer { construct new() {} method { - IO.print(this) // expect: Outer + System.print(this) // expect: Outer Fn.new { - IO.print(this) // expect: Outer + System.print(this) // expect: Outer class Inner { construct new() {} method { - IO.print(this) // expect: Inner + System.print(this) // expect: Inner } toString { "Inner" } } diff --git a/test/language/this/nested_closure.wren b/test/language/this/nested_closure.wren index ccb5f146..6c36d09d 100644 --- a/test/language/this/nested_closure.wren +++ b/test/language/this/nested_closure.wren @@ -5,4 +5,4 @@ class Foo { } var closure = Foo.new().getClosure -IO.print(closure.call().call().call()) // expect: Foo +System.print(closure.call().call().call()) // expect: Foo diff --git a/test/language/this/this_in_method.wren b/test/language/this/this_in_method.wren index ba212a56..08e31b4d 100644 --- a/test/language/this/this_in_method.wren +++ b/test/language/this/this_in_method.wren @@ -4,4 +4,4 @@ class Foo { baz { "baz" } } -IO.print(Foo.new().bar.baz) // expect: baz +System.print(Foo.new().bar.baz) // expect: baz diff --git a/test/language/this/this_in_static_method.wren b/test/language/this/this_in_static_method.wren index 9d07b71a..5a89057f 100644 --- a/test/language/this/this_in_static_method.wren +++ b/test/language/this/this_in_static_method.wren @@ -1,7 +1,7 @@ class Foo { static test { - IO.print(this == Foo) // expect: true - IO.print(this.bar) // expect: bar + System.print(this == Foo) // expect: true + System.print(this.bar) // expect: bar } static bar { "bar" } diff --git a/test/language/unexpected_character.wren b/test/language/unexpected_character.wren index 49b486c2..22a81a17 100644 --- a/test/language/unexpected_character.wren +++ b/test/language/unexpected_character.wren @@ -1,3 +1,3 @@ -IO.print("no") +System.print("no") // Something that's not a valid character: ^ // expect error diff --git a/test/language/variable/global_without_initializer.wren b/test/language/variable/global_without_initializer.wren index e934ae7e..bd1c043d 100644 --- a/test/language/variable/global_without_initializer.wren +++ b/test/language/variable/global_without_initializer.wren @@ -1,2 +1,2 @@ var a -IO.print(a) // expect: null +System.print(a) // expect: null diff --git a/test/language/variable/local_in_initializer.wren b/test/language/variable/local_in_initializer.wren index 9cffc4c0..5d397e46 100644 --- a/test/language/variable/local_in_initializer.wren +++ b/test/language/variable/local_in_initializer.wren @@ -1,4 +1,4 @@ { var a = a + 1 // expect error - IO.print(a) + System.print(a) } diff --git a/test/language/variable/local_in_middle_of_block.wren b/test/language/variable/local_in_middle_of_block.wren index 47266af1..3768329c 100644 --- a/test/language/variable/local_in_middle_of_block.wren +++ b/test/language/variable/local_in_middle_of_block.wren @@ -3,13 +3,13 @@ class Foo { bar { var a = "a" - IO.print(a) // expect: a + System.print(a) // expect: a var b = a + " b" - IO.print(b) // expect: a b + System.print(b) // expect: a b var c = a + " c" - IO.print(c) // expect: a c + System.print(c) // expect: a c var d = b + " d" - IO.print(d) // expect: a b d + System.print(d) // expect: a b d } } diff --git a/test/language/variable/local_in_nested_block.wren b/test/language/variable/local_in_nested_block.wren index 11a82485..e4174410 100644 --- a/test/language/variable/local_in_nested_block.wren +++ b/test/language/variable/local_in_nested_block.wren @@ -1,6 +1,6 @@ { var a = "outer" { - IO.print(a) // expect: outer + System.print(a) // expect: outer } } \ No newline at end of file diff --git a/test/language/variable/local_without_initializer.wren b/test/language/variable/local_without_initializer.wren index 2daea492..f96e96c8 100644 --- a/test/language/variable/local_without_initializer.wren +++ b/test/language/variable/local_without_initializer.wren @@ -1,4 +1,4 @@ { var a - IO.print(a) // expect: null + System.print(a) // expect: null } diff --git a/test/language/variable/many_locals.wren b/test/language/variable/many_locals.wren index d8ab0a5d..97cc20c7 100644 --- a/test/language/variable/many_locals.wren +++ b/test/language/variable/many_locals.wren @@ -255,5 +255,5 @@ var a253 = a252 var a254 = a253 var a255 = a254 - IO.print(a255) // expect: value + System.print(a255) // expect: value } diff --git a/test/language/variable/many_nonsimultaneous_locals.wren b/test/language/variable/many_nonsimultaneous_locals.wren index 2d81fd37..8320c1e9 100644 --- a/test/language/variable/many_nonsimultaneous_locals.wren +++ b/test/language/variable/many_nonsimultaneous_locals.wren @@ -259,7 +259,7 @@ var a253 = a252 var a254 = a253 var a255 = a254 - IO.print(a255) // expect: value a + System.print(a255) // expect: value a } { @@ -519,6 +519,6 @@ var b253 = b252 var b254 = b253 var b255 = b254 - IO.print(b255) // expect: value b + System.print(b255) // expect: value b } } diff --git a/test/language/variable/outside_method.wren b/test/language/variable/outside_method.wren index b2a5d59d..1430b56f 100644 --- a/test/language/variable/outside_method.wren +++ b/test/language/variable/outside_method.wren @@ -6,13 +6,13 @@ class Foo { foo { "method" } method { - IO.print(foo) + System.print(foo) } static foo { "class method" } static classMethod { - IO.print(foo) + System.print(foo) } } diff --git a/test/language/variable/scope_if.wren b/test/language/variable/scope_if.wren index 6fc8a225..9c965b26 100644 --- a/test/language/variable/scope_if.wren +++ b/test/language/variable/scope_if.wren @@ -3,11 +3,11 @@ var a = "out" if (true) { var a = "in" } -IO.print(a) // expect: out +System.print(a) // expect: out // Create a local scope for the 'else' expression. var b = "out" if (false) "dummy" else { var b = "in" } -IO.print(b) // expect: out +System.print(b) // expect: out diff --git a/test/language/variable/scope_reuse_in_different_blocks.wren b/test/language/variable/scope_reuse_in_different_blocks.wren index 92796bab..e452cb4d 100644 --- a/test/language/variable/scope_reuse_in_different_blocks.wren +++ b/test/language/variable/scope_reuse_in_different_blocks.wren @@ -1,9 +1,9 @@ { var a = "first" - IO.print(a) // expect: first + System.print(a) // expect: first } { var a = "second" - IO.print(a) // expect: second + System.print(a) // expect: second } diff --git a/test/language/variable/scope_while.wren b/test/language/variable/scope_while.wren index d8e215b5..a6fe29c3 100644 --- a/test/language/variable/scope_while.wren +++ b/test/language/variable/scope_while.wren @@ -4,4 +4,4 @@ var i = 0 while ((i = i + 1) <= 1) { var a = "inner" } -IO.print(a) // expect: outer +System.print(a) // expect: outer diff --git a/test/language/variable/shadow_and_local.wren b/test/language/variable/shadow_and_local.wren index e069a0bf..500fe2ab 100644 --- a/test/language/variable/shadow_and_local.wren +++ b/test/language/variable/shadow_and_local.wren @@ -1,8 +1,8 @@ { var a = "outer" { - IO.print(a) // expect: outer + System.print(a) // expect: outer var a = "inner" - IO.print(a) // expect: inner + System.print(a) // expect: inner } } \ No newline at end of file diff --git a/test/language/variable/shadow_global.wren b/test/language/variable/shadow_global.wren index 8f86f37d..6d62e55b 100644 --- a/test/language/variable/shadow_global.wren +++ b/test/language/variable/shadow_global.wren @@ -1,6 +1,6 @@ var a = "global" { var a = "shadow" - IO.print(a) // expect: shadow + System.print(a) // expect: shadow } -IO.print(a) // expect: global \ No newline at end of file +System.print(a) // expect: global \ No newline at end of file diff --git a/test/language/variable/shadow_in_initializer.wren b/test/language/variable/shadow_in_initializer.wren index e0f76a4c..d6055b7a 100644 --- a/test/language/variable/shadow_in_initializer.wren +++ b/test/language/variable/shadow_in_initializer.wren @@ -2,6 +2,6 @@ var a = "outer" { var a = a + " inner" - IO.print(a) // expect: outer inner + System.print(a) // expect: outer inner } } diff --git a/test/language/variable/shadow_local.wren b/test/language/variable/shadow_local.wren index 8234a5c4..0c913b14 100644 --- a/test/language/variable/shadow_local.wren +++ b/test/language/variable/shadow_local.wren @@ -2,7 +2,7 @@ var a = "local" { var a = "shadow" - IO.print(a) // expect: shadow + System.print(a) // expect: shadow } - IO.print(a) // expect: local + System.print(a) // expect: local } \ No newline at end of file diff --git a/test/language/variable/undefined_global.wren b/test/language/variable/undefined_global.wren index 196b010b..f470fe6a 100644 --- a/test/language/variable/undefined_global.wren +++ b/test/language/variable/undefined_global.wren @@ -1 +1 @@ -IO.print(notDefined) // expect error +System.print(notDefined) // expect error diff --git a/test/language/variable/undefined_local.wren b/test/language/variable/undefined_local.wren index a9592bef..da8f1098 100644 --- a/test/language/variable/undefined_local.wren +++ b/test/language/variable/undefined_local.wren @@ -1,3 +1,3 @@ Fn.new { - IO.print(notDefined) // expect error + System.print(notDefined) // expect error }.call() diff --git a/test/language/while/closure_in_body.wren b/test/language/while/closure_in_body.wren index adc0cf57..41134424 100644 --- a/test/language/while/closure_in_body.wren +++ b/test/language/while/closure_in_body.wren @@ -3,7 +3,7 @@ var list = [] var i = 1 while (i < 4) { var j = i + 1 - list.add(Fn.new { IO.print(j) }) + list.add(Fn.new { System.print(j) }) i = i + 1 } diff --git a/test/language/while/newline_after_while.wren b/test/language/while/newline_after_while.wren index 7bc26cc0..282d9938 100644 --- a/test/language/while/newline_after_while.wren +++ b/test/language/while/newline_after_while.wren @@ -1,2 +1,2 @@ while // expect error -(true) IO.print("bad") +(true) System.print("bad") diff --git a/test/language/while/return_closure.wren b/test/language/while/return_closure.wren index 89859339..628f363e 100644 --- a/test/language/while/return_closure.wren +++ b/test/language/while/return_closure.wren @@ -1,7 +1,7 @@ var f = Fn.new { while (true) { var i = "i" - return Fn.new { IO.print(i) } + return Fn.new { System.print(i) } } } diff --git a/test/language/while/return_inside.wren b/test/language/while/return_inside.wren index 33ec8887..ab7dcde0 100644 --- a/test/language/while/return_inside.wren +++ b/test/language/while/return_inside.wren @@ -5,5 +5,5 @@ var f = Fn.new { } } -IO.print(f.call()) +System.print(f.call()) // expect: i diff --git a/test/language/while/syntax.wren b/test/language/while/syntax.wren index 5398dd8e..6244aa81 100644 --- a/test/language/while/syntax.wren +++ b/test/language/while/syntax.wren @@ -1,6 +1,6 @@ // Single-expression body. var c = 0 -while (c < 3) IO.print(c = c + 1) +while (c < 3) System.print(c = c + 1) // expect: 1 // expect: 2 // expect: 3 @@ -8,7 +8,7 @@ while (c < 3) IO.print(c = c + 1) // Block body. var a = 0 while (a < 3) { - IO.print(a) + System.print(a) a = a + 1 } // expect: 0 diff --git a/test/language/while/truth.wren b/test/language/while/truth.wren index 32a625b2..ece02e7f 100644 --- a/test/language/while/truth.wren +++ b/test/language/while/truth.wren @@ -1,26 +1,26 @@ // False and null are false. while (false) { - IO.print("bad") + System.print("bad") break } while (null) { - IO.print("bad") + System.print("bad") break } // Everything else is true. while (true) { - IO.print("true") // expect: true + System.print("true") // expect: true break } while (0) { - IO.print(0) // expect: 0 + System.print(0) // expect: 0 break } while ("") { - IO.print("string") // expect: string + System.print("string") // expect: string break } diff --git a/test/language/whitespace.wren b/test/language/whitespace.wren index a5fac6b2..3ff2a9c3 100644 --- a/test/language/whitespace.wren +++ b/test/language/whitespace.wren @@ -1,26 +1,26 @@ // No indent -IO.print("ok") // expect: ok +System.print("ok") // expect: ok // Indent with space - IO.print("ok") // expect: ok + System.print("ok") // expect: ok // Indent with tab - IO.print("ok") // expect: ok + System.print("ok") // expect: ok // Indent with space then tab - IO.print("ok") // expect: ok + System.print("ok") // expect: ok // Indent with tab then space - IO.print("ok") // expect: ok + System.print("ok") // expect: ok // Indent with mixed tab and space - IO.print("ok") // expect: ok + System.print("ok") // expect: ok // Space in with code -IO . print ( "ok" ) // expect: ok +System . print ( "ok" ) // expect: ok // Tab in with code -IO . print ( "ok" ) // expect: ok +System . print ( "ok" ) // expect: ok // Tab and space mixed in with code -IO . print ( "ok" ) // expect: ok +System . print ( "ok" ) // expect: ok diff --git a/test/limit/long_function.wren b/test/limit/long_function.wren index 61e97836..255dae38 100644 --- a/test/limit/long_function.wren +++ b/test/limit/long_function.wren @@ -1,1013 +1,1013 @@ Fn.new { - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 // 100 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 // 200 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 // 300 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 // 400 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 // 500 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 // 600 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 // 700 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 // 800 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 // 900 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 - IO.print(1) // expect: 1 - IO.print(2) // expect: 2 - IO.print(3) // expect: 3 - IO.print(4) // expect: 4 - IO.print(5) // expect: 5 - IO.print(6) // expect: 6 - IO.print(7) // expect: 7 - IO.print(8) // expect: 8 - IO.print(9) // expect: 9 - IO.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 + System.print(1) // expect: 1 + System.print(2) // expect: 2 + System.print(3) // expect: 3 + System.print(4) // expect: 4 + System.print(5) // expect: 5 + System.print(6) // expect: 6 + System.print(7) // expect: 7 + System.print(8) // expect: 8 + System.print(9) // expect: 9 + System.print(10) // expect: 10 // 1000 }.call() diff --git a/test/limit/long_string.wren b/test/limit/long_string.wren index eeb7724d..cdde68f1 100644 --- a/test/limit/long_string.wren +++ b/test/limit/long_string.wren @@ -1,6 +1,6 @@ // Create a very long string containing escape sequences. var s = "1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890" -IO.print(s) +System.print(s) // expect: 1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890 // expect: 1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890 // expect: 1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890 diff --git a/test/limit/many_constants.wren b/test/limit/many_constants.wren index 6328799c..678cdf6c 100644 --- a/test/limit/many_constants.wren +++ b/test/limit/many_constants.wren @@ -65534,7 +65534,7 @@ var f = Fn.new { 65533 65534 65535 - IO.print(65536) + System.print(65536) } f.call() // expect: 65536 diff --git a/test/limit/many_fields.wren b/test/limit/many_fields.wren index eed2a9b6..15d469ce 100644 --- a/test/limit/many_fields.wren +++ b/test/limit/many_fields.wren @@ -255,7 +255,7 @@ class Foo { _field253 = 253 _field254 = 254 _field255 = 255 - IO.print(_field255) + System.print(_field255) } } diff --git a/test/limit/many_globals.wren b/test/limit/many_globals.wren index a237f52c..65710d5e 100644 --- a/test/limit/many_globals.wren +++ b/test/limit/many_globals.wren @@ -4095,7 +4095,7 @@ var global4094 = 4094 var global4095 = 4095 var global4096 = 4096 -IO.print(global4096) // expect: 4096 +System.print(global4096) // expect: 4096 // Symbol tables currently use O(n) to look up names. This makes this test // painfully slow when a large number of names are defined. This is a @@ -65484,5 +65484,5 @@ var global65472 = 65472 // Not defining the full 65,536 here because the core library also defines some // global names. -IO.print(global65472) // expect 65472 +System.print(global65472) // expect 65472 */ diff --git a/test/limit/many_inherited_fields.wren b/test/limit/many_inherited_fields.wren index c63e99b1..4baea699 100644 --- a/test/limit/many_inherited_fields.wren +++ b/test/limit/many_inherited_fields.wren @@ -131,8 +131,8 @@ class Foo { } foo { - IO.print(_field1) - IO.print(_field128) + System.print(_field1) + System.print(_field128) } } @@ -269,8 +269,8 @@ class Bar is Foo { } bar { - IO.print(_field129) - IO.print(_field255) + System.print(_field129) + System.print(_field255) } } diff --git a/test/limit/too_many_constants.wren b/test/limit/too_many_constants.wren index 9bdf97f5..48ea226a 100644 --- a/test/limit/too_many_constants.wren +++ b/test/limit/too_many_constants.wren @@ -65535,5 +65535,5 @@ var f = Fn.new { 65534 65535 66536 - IO.print(65537) // expect error + System.print(65537) // expect error } diff --git a/test/limit/too_many_inherited_fields.wren b/test/limit/too_many_inherited_fields.wren index 0c90bff1..f95f679f 100644 --- a/test/limit/too_many_inherited_fields.wren +++ b/test/limit/too_many_inherited_fields.wren @@ -131,8 +131,8 @@ class Foo { } foo { - IO.print(_field1) - IO.print(_field128) + System.print(_field1) + System.print(_field128) } } @@ -270,8 +270,8 @@ class Bar is Foo { // expect runtime error: Class 'Bar' may not have more than 2 } bar { - IO.print(_field129) - IO.print(_field256) + System.print(_field129) + System.print(_field256) } } diff --git a/test/meta/eval_existing_scoped_variable.wren b/test/meta/eval_existing_scoped_variable.wren index 90c44873..82b80466 100644 --- a/test/meta/eval_existing_scoped_variable.wren +++ b/test/meta/eval_existing_scoped_variable.wren @@ -2,4 +2,4 @@ var y Meta.eval("y = 2") -IO.print(y) // expect: 2 \ No newline at end of file +System.print(y) // expect: 2 \ No newline at end of file diff --git a/test/scheduler/add.wren b/test/scheduler/add.wren index 7dd7d08e..e12062bc 100644 --- a/test/scheduler/add.wren +++ b/test/scheduler/add.wren @@ -7,9 +7,9 @@ Scheduler.add { } // Does not run immediately. -IO.print(run) // expect: false +System.print(run) // expect: false Timer.sleep(0) // Runs when the main fiber suspends on IO. -IO.print(run) // expect: true +System.print(run) // expect: true diff --git a/test/timer/sleep_called_fibers.wren b/test/timer/sleep_called_fibers.wren index a5598ef0..bb77cb49 100644 --- a/test/timer/sleep_called_fibers.wren +++ b/test/timer/sleep_called_fibers.wren @@ -1,21 +1,21 @@ import "timer" for Timer var a = Fiber.new { - IO.print("a before") + System.print("a before") Timer.sleep(10) - IO.print("a after") + System.print("a after") } var b = Fiber.new { - IO.print("b before") + System.print("b before") a.call() - IO.print("b after") + System.print("b after") } // All fibers are suspended since they were directly called and not scheduled. -IO.print("before") // expect: before +System.print("before") // expect: before b.call() // expect: b before // expect: a before // expect: a after // expect: b after -IO.print("done") // expect: done +System.print("done") // expect: done diff --git a/test/timer/sleep_fibers.wren b/test/timer/sleep_fibers.wren index e7038234..68706de0 100644 --- a/test/timer/sleep_fibers.wren +++ b/test/timer/sleep_fibers.wren @@ -3,17 +3,17 @@ import "timer" for Timer Scheduler.add { Timer.sleep(2) - IO.print("a") + System.print("a") } Scheduler.add { Timer.sleep(1) - IO.print("b") + System.print("b") } -IO.print("main") +System.print("main") Timer.sleep(3) -IO.print("done") +System.print("done") // expect: main // expect: b // expect: a diff --git a/test/timer/sleep_float.wren b/test/timer/sleep_float.wren index 43142986..b166ab30 100644 --- a/test/timer/sleep_float.wren +++ b/test/timer/sleep_float.wren @@ -4,17 +4,17 @@ import "timer" for Timer // These are both rounded to 1, so "a" should complete first. Scheduler.add { Timer.sleep(1.5) - IO.print("a") + System.print("a") } Scheduler.add { Timer.sleep(1.3) - IO.print("b") + System.print("b") } -IO.print("main") +System.print("main") Timer.sleep(3) -IO.print("done") +System.print("done") // expect: main // expect: a // expect: b diff --git a/test/timer/sleep_main_fiber.wren b/test/timer/sleep_main_fiber.wren index 3e3e43fb..302d6917 100644 --- a/test/timer/sleep_main_fiber.wren +++ b/test/timer/sleep_main_fiber.wren @@ -1,9 +1,9 @@ import "timer" for Timer -IO.print("1") // expect: 1 +System.print("1") // expect: 1 Timer.sleep(3) -IO.print("2") // expect: 2 +System.print("2") // expect: 2 Timer.sleep(3) -IO.print("3") // expect: 3 +System.print("3") // expect: 3 Timer.sleep(3) -IO.print("4") // expect: 4 +System.print("4") // expect: 4 diff --git a/test/timer/sleep_return.wren b/test/timer/sleep_return.wren index 6b6484d2..ada6cca5 100644 --- a/test/timer/sleep_return.wren +++ b/test/timer/sleep_return.wren @@ -1,3 +1,3 @@ import "timer" for Timer -IO.print(Timer.sleep(0)) // expect: null +System.print(Timer.sleep(0)) // expect: null diff --git a/test/timer/sleep_zero.wren b/test/timer/sleep_zero.wren index 2240ea2c..d56cfb08 100644 --- a/test/timer/sleep_zero.wren +++ b/test/timer/sleep_zero.wren @@ -2,22 +2,22 @@ import "scheduler" for Scheduler import "timer" for Timer Scheduler.add { - IO.print("a before") + System.print("a before") Timer.sleep(0) - IO.print("a after") + System.print("a after") } Scheduler.add { - IO.print("b before") + System.print("b before") Timer.sleep(0) - IO.print("b after") + System.print("b after") } -IO.print("main") +System.print("main") Timer.sleep(0) // This is enough to let the other fibers run to their sleep. -IO.print("main after") +System.print("main after") Timer.sleep(0) // And now their sleeps complete. -IO.print("done") +System.print("done") // expect: main // expect: a before