8000 Rebased on #5003 NewLambda · scala-wasm/scala-wasm@c32a822 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit c32a822

Browse files
committed
Rebased on scala-js#5003 NewLambda
Now JSArrayConstr for Array[T](...) Seq[T](...) List[T](...) is the problem
1 parent 341c918 commit c32a822

File tree

6 files changed

+70
-66
lines changed

6 files changed

+70
-66
lines changed

examples/test-suite-wasi/src/main/scala/test-suites-wasi/CompilerTest.scala

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ object CompilerTest {
4949
test.switchWithGuardsStat()
5050
test.switchWithGuardsExpr()
5151

52-
// Closure
53-
// scala/collection/immutable/WrappedString.scala,63
52+
// TODO: JSArrayConstr in HashSet
5453
// test.matchWithNonIdentityMatchEndScalaLib()
5554

5655
test.matchWithNonIdentityMatchEndIndependent()
@@ -123,38 +122,46 @@ object CompilerTest {
123122

124123
}
125124

126-
// Closure
127125
locally {
128126
val test = new RuntimeTypeTestsTest
129-
// test.objectType()
130-
// test.regularClass()
131-
// test.regularInterface()
132-
// test.serializableAndCloneable()
133-
// test.javaLangNumber()
134-
// test.primitiveTypes()
135-
// test.unit()
136-
// test.string()
137-
// test.arrayTypes()
138-
// test.nothingType()
139-
// test.nullType()
127+
import test._
128+
objectType()
129+
130+
// TODO: JSArrayConstr (List(...))
131+
regularClass()
132+
regularInterface()
133+
134+
// TODO: hit jsValueType
135+
// serializableAndCloneable()
136+
// javaLangNumber()
137+
// primitiveTypes()
138+
139+
unit()
140+
141+
// TODO: JSArrayConstr (List(...))
142+
string()
143+
arrayTypes()
144+
145+
nothingType()
146+
nullType() // TODO: JSArrayConstr (List(...))
140147
}
141148

142149
locally {
143150
val test = new SAMTest
144151
test.javaCallable()
145152
test.specialResultTypes()
146153
test.javaComparator()
147-
// TODO: Closure
154+
// TODO: expected (ref $type), found (ref extern)
148155
// test.samHasDefaultMethod()
149156
test.specialParamTypes()
150157
test.nonLFMCapableSAM()
151158
}
152159

153160
locally {
154161
val test = new SAMWithOverridingBridgesTest
155-
// TOOD: Closure
156-
// test.testVariantA()
157-
// test.testVariantB()
162+
import test._
163+
testVariantA()
164+
testVariantB()
158165
}
159166

160167
locally {

examples/test-suite-wasi/src/main/scala/test-suites-wasi/JavalibLangTest.scala

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ object JavalibLangTest {
5050
// highSurrogate()
5151
// lowSurrogate()
5252

53-
// TODO: Closure
53+
// TODO: Math.random
5454
// isISOControl()
5555

56-
// TODO: Closure
56+
// TODO: JSArrayConstr
5757
// digit()
5858

5959
forDigit()
@@ -80,23 +80,21 @@ object JavalibLangTest {
8080
offsetByCodePointsArrayBackwards()
8181
isDigit()
8282

83-
// TODO: Closure
83+
// TODO: JSArrayConstr in NumericRange
8484
// toLowerCaseCompareCharAndCodepoint()
85+
// toUpperCaseCompareCharAndCodepoint()
86+
// toTitleCaseCompareCharAndCodepoint()
87+
// isIdentifierIgnorable()
88+
// isUpperCase()
8589

8690
toLowerCaseInt()
8791
toLowerCaseCodePointSpecialCases()
8892
toLowerCaseCodePointStringLowerCaseDiffCharacterLowerCase()
8993

90-
// TODO: Closure
91-
// toUpperCaseCompareCharAndCodepoint()
92-
9394
toUpperCaseInt()
9495
toUpperCaseCodePointSpecialCases()
9596
toUpperCaseCodePointStringUpperCaseDiffCharacterUpperCase()
9697

97-
// TODO: Closure
98-
// toTitleCaseCompareCharAndCodepoint()
99-
10098
toTitleCaseCodePointSpecialCases()
10199
toTitleCaseCodePointStringUpperCaseDiffCharacterTitleCase()
102100

@@ -107,15 +105,9 @@ object JavalibLangTest {
107105
compareTo()
108106
compareToAnyAny()
109107

110-
// TODO: Closure
111-
// isIdentifierIgnorable()
112-
113108
isUnicodeIdentifierStart()
114109
isUnicodeIdentifierPart()
115110

116-
// TODO: Closure
117-
// isUpperCase()
118-
119111
isAlphabetic()
120112
isIdeographic()
121113
isSpaceChar()
@@ -146,10 +138,10 @@ object JavalibLangTest {
146138
// forNameString()
147139
}
148140

141+
// TODO: JSArrayConstr (Seq(...))
149142
locally {
150143
// val test = new ClassTest
151144
// import test._
152-
// TODO: Closure
153145
// hierarchy()
154146
// getPrimitiveTypeName()
155147
// getClassGetName()
@@ -159,7 +151,6 @@ object JavalibLangTest {
159151
// JSSelect: hasOwnProperty: Utils.scala
160152
// getSimpleName()
161153

162-
// Closure
163154
// isAssignableFrom()
164155
// getComponentType()
165156
}
@@ -286,7 +277,7 @@ object JavalibLangTest {
286277
val test = new IterableDefaultTest
287278
import test._
288279
empty()
289-
// TODO: Closure (WrappedString 63)
280+
// TODO: JSArrayConstr
290281
// simpleSum()
291282
// iteratorThrowsNoSuchElementException()
292283
}
@@ -399,16 +390,18 @@ object JavalibLangTest {
399390

400391
appendCodePoint()
401392

402-
// TODO: Closure in WrappedString
393+
// TODO: JSArrayConstr
403394
// getChars()
404395

405396
delete()
406397
deleteCharAt()
407398
replace()
408399
insertCharArrayOffsetLen()
409-
// insertAnyRef()
410400
insertString()
411401
insertCharArray()
402+
403+
// TODO: asesertion fail
404+
// insertAnyRef()
412405
// insertCharSequence()
413406
// insertCharSequenceStartEnd()
414407
// insertPrimitive()
@@ -426,7 +419,7 @@ object JavalibLangTest {
426419
setLength()
427420
charAt()
428421

429-
// TODO
422+
// TODO: codePointAt
430423
// codePointAt()
431424

432425
codePointBefore()
@@ -489,7 +482,7 @@ object JavalibLangTest {
489482
codePointCount()
490483
offsetByCodePoints()
491484
offsetByCodePointsBackwards()
492-
// TODO: Closure: WrappedString
485+
// TODO: JSArrayConstr
493486
// getChars()
494487
setCharAt()
495488
substringStart()
@@ -547,15 +540,18 @@ object JavalibLangTest {
547540
toCharArray()
548541
hashCodeTest()
549542

550-
// TODO: Closure in WrappedString
551-
// getChars()
543+
getChars()
552544
concat()
553545
constructors()
546+
547+
// TODO: JSFunctionApply
554548
// format()
549+
// TODO: hasOwnProperty
555550
// getBytes()
551+
556552
regionMatches()
557553

558-
// TODO Closure
554+
// TODO JSArrayConstr (NumRanges)
559555
// trim()
560556
// createFromLargeCharArray_Issue2553()
561557
// createFromLargeCodePointArray_Issue2553()
@@ -566,7 +562,7 @@ object JavalibLangTest {
566562
locally {
567563
val test = new SystemArraycopyTest
568564
import test._
569-
// TODO: Closure in WrappedString
565+
// TODO: JSArrayConstr in SystemArrayCopyTest
570566
// simpleTests()
571567
arraycopyWithRangeOverlapsForTheSameArrayInt()
572568
arraycopyWithRangeOverlapsForTheSameArrayBoolean()
@@ -634,13 +630,12 @@ object JavalibLangTest {
634630
import test._
635631

636632
allJavaLangErrorsAndExceptions()
637-
// TODO: Closure
638-
// throwableMessage_Issue2559()
F438 633+
throwableMessage_Issue2559()
639634

640635
// TODO: test fail (why?)
641636
// noWritableStackTrace()
642637

643-
// TODO: Closure
638+
// TODO: JSArrayConstr
644639
// suppression()
645640
noSuppression()
646641
throwableStillHasMethodsOfObject()

examples/test-suite-wasi/src/main/scala/test-suites-wasi/JavalibUtilTest.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ object JavalibUtilTest {
1212
// Arrays.sort
1313

1414
// Arrays.fill
15-
// TODO: Closure in WrappedString
1615
fillBoolean()
1716
fillBooleanWithStartAndEndIndex()
17+
// TODO: JSArrayConstr (Array[Short](...))
1818
// fillByte()
1919
// fillByteWithStartAndEndIndex()
2020
// fillShort()
@@ -35,7 +35,7 @@ object JavalibUtilTest {
3535
binarySearchOnLong()
3636
binarySearchWithStartAndEndIndexOnInt()
3737
binarySearchOnInt()
38-
// TODO: Closure
38+
// TODO: JSArrayConstr
3939
// binarySearchWithStartAndEndIndexOnShort()
4040
// binarySearchOnShort()
4141

@@ -62,11 +62,11 @@ object JavalibUtilTest {
6262

6363
asList()
6464

65-
// TODO: Closure in WrappedString
65+
// TODO: JSArrayConstr
6666
// hashCode tests
6767

6868
equalsBooleans()
69-
// TODO: Closure in WrappedString
69+
// TODO: JSArrayConstr
7070
// equalsBytes()
7171
// equalsChars()
7272

@@ -76,7 +76,7 @@ object JavalibUtilTest {
7676
// equalsFloats()
7777
// equalsDoubles()
7878

79-
// TODO: Closure in WrappedString
79+
// TODO: JSArrayConstr
8080
deepEquals()
8181

8282
toStringAnyRef()

examples/test-suite-wasi/src/main/scala/test-suites-wasi/compiler/RuntimeTypeTestsTest.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class RuntimeTypeTestsTest {
5050

5151
testOption(true, Some(5))
5252
testOption(true, None)
53-
testOption(false, List(5))
53+
// testOption(false, List(5))
5454
testOption(false, 5)
5555
testOption(false, new Array[Int](5))
5656
testOption(false, new Array[String](5))
@@ -64,7 +64,7 @@ class RuntimeTypeTestsTest {
6464

6565
testSeq(false, Some(5))
6666
testSeq(false, None)
67-
testSeq(true, List(5))
67+
// testSeq(true, List(5))
6868
testSeq(false, 5)
6969
testSeq(false, new Array[Int](5))
7070
testSeq(false, new Array[String](5))
@@ -115,7 +115,7 @@ class RuntimeTypeTestsTest {
115115
testCloneable(false, true)
116116
testCloneable(false, 'Z')
117117
testCloneable(false, "hello")
118-
testCloneable(false, List(5))
118+
// testCloneable(false, List(5))
119119
testCloneable(false, new Foo)
120120
testCloneable(false, new MySerializable)
121121
}
@@ -285,7 +285,7 @@ class RuntimeTypeTestsTest {
285285
testString(true, "a")
286286

287287
testString(false, 1)
288-
testString(false, List(5))
288+
// testString(false, List(5))
289289

290290
testNullValue(classOf[String], _.isInstanceOf[String], _.asInstanceOf[String])
291291
}
@@ -308,7 +308,7 @@ class RuntimeTypeTestsTest {
308308

309309
testArrayObject(false, new Array[Int](5))
310310
testArrayObject(false, new Array[Long](5))
311-
testArrayObject(false, List(5))
311+
// testArrayObject(false, List(5))
312312
testArrayObject(false, new Object)
313313

314314
testNullValue(classOf[Array[Object]], _.isInstanceOf[Array[Object]], _.asInstanceOf[Array[Object]])
@@ -321,7 +321,7 @@ class RuntimeTypeTestsTest {
321321

322322
testArrayList(false, new Array[Seq[_]](5))
323323
testArrayList(false, new Array[Object](5))
324-
testArrayList(false, List(5))
324+
// testArrayList(false, List(5))
325325
testArrayList(false, new Object)
326326

327327
testNullValue(classOf[Array[List[_]]], _.isInstanceOf[Array[List[_]]], _.asInstanceOf[Array[List[_]]])
@@ -335,7 +335,7 @@ class RuntimeTypeTestsTest {
335335

336336
testArraySeq(false, new Array[Map[_, _]](5))
337337
testArraySeq(false, new Array[Object](5))
338-
testArraySeq(false, List(5))
338+
// testArraySeq(false, List(5))
339339
testArraySeq(false, new Object)
340340

341341
testNullValue(classOf[Array[Seq[_]]], _.isInstanceOf[Array[Seq[_]]], _.asInstanceOf[Array[Seq[_]]])
@@ -347,7 +347,7 @@ class RuntimeTypeTestsTest {
347347

348348
testArrayInt(false, new Array[Long](5))
349349
testArrayInt(false, new Array[Object](5))
350-
testArrayInt(false, List(5))
350+
// testArrayInt(false, List(5))
351351
testArrayInt(false, new Object)
352352

353353
testNullValue(classOf[Array[Int]], _.isInstanceOf[Array[Int]], _.asInstanceOf[Array[Int]])
@@ -378,7 +378,7 @@ class RuntimeTypeTestsTest {
378378
testArrayArrayObject(false, new Array[Int](5))
379379
testArrayArrayObject(false, new Array[Long](5))
380380

381-
testArrayArrayObject(false, List(5))
381+
// testArrayArrayObject(false, List(5))
382382
testArrayArrayObject(false, new Object)
383383

384384
testNullValue(classOf[Array[Array[Object]]],
@@ -411,7 +411,7 @@ class RuntimeTypeTestsTest {
411411
test[Nothing](expected, value, classOf[Nothing], isInstance, _.asInstanceOf[Nothing])
412412

413413
testNothing(false, "a")
414-
testNothing(false, List(5))
414+
// testNothing(false, List(5))
415415

416416
/* The behavior of casting for null is not consistent, due to how scalac
417417
* desugars things. This is true both on JS and on the JVM. To test null,
@@ -436,7 +436,7 @@ class RuntimeTypeTestsTest {
436436
testNull(false, 0)
437437
testNull(false, false)
438438
testNull(false, ())
439-
testNull(false, List(5))
439+
// testNull(false, List(5))
440440
}
441441

442442
}

examples/test-suite-wasi/src/main/scala/test-suites-wasi/javalib/util/ArraysTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ class ArraysTest {
10101010
Array[AnyRef](Array[AnyRef](Array[Double]())),
10111011
Array[AnyRef](Array[AnyRef](Array[Double]()))))
10121012

1013-
// TODO: Closure in WrappedString
1013+
// TODO: JSArrayConstr
10141014
/*
10151015
assertTrue(Arrays.deepEquals(
10161016
Array[AnyRef](Array[AnyRef](Array[Int](1))),

0 commit comments

Comments
 (0)
0