diff options
author | Jon Pretty <jon.pretty@propensive.com> | 2017-06-22 18:28:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-22 18:28:30 +0100 |
commit | 27a55611230b772eae1f0a37822decb43c21ac25 (patch) | |
tree | 3613b2a36440d026fa9b2efa184d255b0e59b98d /tests/shared | |
parent | 70919a58e73e928d1e2c04a22a0636897e45816c (diff) | |
parent | 6e702a5a5fb9f9d508e0a9ddbbbfc2cb64267971 (diff) | |
download | magnolia-27a55611230b772eae1f0a37822decb43c21ac25.tar.gz magnolia-27a55611230b772eae1f0a37822decb43c21ac25.tar.bz2 magnolia-27a55611230b772eae1f0a37822decb43c21ac25.zip |
Merge pull request #5 from propensive/use-case-instead-of-asinstanceof
Use case clauses and switch statement instead of is/asInstanceOf
Diffstat (limited to 'tests/shared')
-rw-r--r-- | tests/shared/src/main/scala/magnolia/main.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/shared/src/main/scala/magnolia/main.scala b/tests/shared/src/main/scala/magnolia/main.scala index 9449f8d..3ac3fb6 100644 --- a/tests/shared/src/main/scala/magnolia/main.scala +++ b/tests/shared/src/main/scala/magnolia/main.scala @@ -5,13 +5,15 @@ import examples._ object Main { def main(args: Array[String]): Unit = { - val tree1: Tree = Branch(Branch(Leaf(1, "abc"), Leaf(2, "def")), Leaf(3, "ghi")) - val tree2: Tree = Branch(Leaf(1, "abc"), Leaf(2, "def")) + val tree1: Tree = Branch(Branch(Leaf(1), Leaf(2)), Leaf(3)) + val tree2: Tree = Branch(Leaf(1), Leaf(2)) println(tree1.show) println(tree1 isEqualTo tree1) println(tree1 isEqualTo tree2) + println(Branch(Branch(Leaf(1), Leaf(2)), Leaf(3)).show) + println(List[Entity](Person("John Smith", Address(List("1 High Street", "London", "SW1A 1AA"), Country("UK", "GBR", false)))).show) |