Skip to content

Commit 71fa8b9

Browse files
committed
Fix some tests
1 parent e996f5d commit 71fa8b9

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

effekt/js/src/main/scala/effekt/EffektConfig.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ trait EffektConfig {
2020
def prelude(): List[String] = List(
2121
"effekt",
2222
"option",
23+
"stream",
2324
"list",
2425
"result",
2526
"exception",
2627
"array",
2728
"char",
29+
"bytearray",
2830
"string",
2931
"ref"
3032
)

effekt/jvm/src/test/scala/effekt/LSPTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ class LSPTests extends FunSuite {
13801380
val expectedIRContents =
13811381
raw"""ModuleDecl(
13821382
| test,
1383-
| List(effekt, option, list, result, exception, array, char, string, ref),
1383+
| List(effekt, option, stream, list, result, exception, array, char, bytearray, string, ref),
13841384
| Nil,
13851385
| Nil,
13861386
| List(

examples/stdlib/array/map.effekt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ def main() = {
33
arr.map { x => x * 2 }
44
println(arr)
55

6-
val arr1 = allocate(0)
6+
val arr1 = array::allocate(0)
77
arr1.map { x => x * 2 }
88
println(arr1)
99
}

examples/stdlib/stream/fibonacci.effekt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import stream
21

32
def main() = {
43
val max = 10
54

6-
val fibs = collectList[Int] {
5+
val fibs = list::collect[Int] {
76
var a = 0
87
var b = 1
98

libraries/common/json.effekt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def decodeJsonObject(): Unit / {Scan[Char], JsonObjectBuilder, Exception[WrongFo
179179
skipWhitespace()
180180
while(do peek[Char]() is c and (c != '}')) {
181181
if (not(first)) { expectString(",") }
182-
val k: String = collect { readQuotedString() }
182+
val k = string::collect { readQuotedString() }
183183
skipWhitespace()
184184
expectString(":")
185185
do field(k){
@@ -277,7 +277,7 @@ def build[R](){ body: => R / JsonBuilder }: (R, JsonValue) = {
277277
}
278278
(x, r)
279279
}
280-
def buildList[R](){ body: => R / JsonBuilder }: (R, List[JsonValue]) = returning::collectList[JsonValue, R] {
280+
def buildList[R](){ body: => R / JsonBuilder }: (R, List[JsonValue]) = list::returning::collect[JsonValue, R] {
281281
try body() with JsonBuilder {
282282
def number(n) = { do emit(Number(n)); resume(()) }
283283
def bool(b) = { do emit(Bool(b)); resume(()) }
@@ -295,7 +295,7 @@ def buildList[R](){ body: => R / JsonBuilder }: (R, List[JsonValue]) = returning
295295
}
296296
}
297297
}
298-
def buildDict[R](){ body: => R / JsonObjectBuilder }: (R, List[(String, JsonValue)]) = returning::collectList[(String, JsonValue), R] {
298+
def buildDict[R](){ body: => R / JsonObjectBuilder }: (R, List[(String, JsonValue)]) = list::returning::collect[(String, JsonValue), R] {
299299
try body() with JsonObjectBuilder {
300300
def field(k) = resume { {v} =>
301301
val x = build{v}
@@ -315,7 +315,7 @@ namespace test {
315315
// Read quoted string
316316
feed("\"\ta\n\ra\"") {
317317
with scanner[Char]
318-
println(collect { readQuotedString() })
318+
println(string::collect { readQuotedString() })
319319
}
320320

321321
println("")

libraries/common/random.effekt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module random
22

33
import stream
4-
ipmort io/filesystem
4+
import io/filesystem
55
import io/error
66

77
/// Infinite pull stream of random bytes.

libraries/common/set.effekt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def collect[A](compare: (A, A) => Ordering at {}) { stream: () => Unit / emit[A]
249249
namespace returning {
250250
def collect[A, R](compare: (A, A) => Ordering at {}) { stream: () => R / emit[A] }: (R, Set[A]) =
251251
try {
252-
(stream(), set::empty(compare))
252+
(stream(), empty(compare))
253253
} with emit[A] { (v) =>
254254
val (r, set) = resume(());
255255
(r, set.insert(v))

0 commit comments

Comments
 (0)