File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ import compat.StringBuilder;
21
21
[serializable]
22
22
class Atom [+ A ]( val data : A ) extends SpecialNode {
23
23
24
+ data match {
25
+ case null => new IllegalArgumentException (" cannot construct Atom(null)" )
26
+ case _ =>
27
+ }
24
28
final override def typeTag$ : Int = - 1 ;
25
29
26
30
/** the constant "#PCDATA"
Original file line number Diff line number Diff line change 1
- <hello>()</hello>
2
1
passed ok
3
- <hello>()</hello>
2
+ passed ok
4
3
passed ok
5
4
<hello>world</hello>
6
5
passed ok
Original file line number Diff line number Diff line change @@ -13,13 +13,18 @@ object Test {
13
13
import NodeSeq .view
14
14
import testing .UnitTest ._
15
15
16
- val x0 = <hello >{}</hello >
17
- val x00 = <hello >{ }</hello >
16
+ val xNull = <hello >{null }</hello > // these used to be Atom(unit), changed to empty children
17
+
18
+ assertSameElements( xNull.child, Nil )
19
+
20
+ val x0 = <hello >{}</hello > // these used to be Atom(unit), changed to empty children
21
+ val x00 = <hello >{ }</hello > // dto.
22
+
18
23
val xa = <hello >{ " world" }</hello >
19
24
20
25
21
- assertEquals( handle[ Unit ](x0) , {} )
22
- assertEquals( handle[ Unit ]( x00), {} )
26
+ assertSameElements( x0.child , Nil )
27
+ assertSameElements( x00.child, Nil )
23
28
assertEquals( handle[String ](xa)," world" )
24
29
25
30
val xb = <hello >{ 1.5 }</hello >
You can’t perform that action at this time.
0 commit comments