pre_testing3/postfix_test7.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Wed, 02 Dec 2020 01:15:14 +0000
changeset 382 1bd800376e0c
parent 346 663c2a9108d1
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
346
663c2a9108d1 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 300
diff changeset
     1
import CW8a._
300
72688efdf17c updated testing files
Christian Urban <urbanc@in.tum.de>
parents: 249
diff changeset
     2
249
1997cfcd6334 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
1997cfcd6334 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
assert(syard(split("3 + 4 * ( 2 - 1 )")) == List("3", "4", "2", "1", "-", "*", "+"))
1997cfcd6334 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
assert(syard(split("( ( ( 3 ) ) + ( ( 4 + ( 5 ) ) ) )")) == List("3", "4", "5", "+", "+"))
1997cfcd6334 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
assert(syard(split("5 + 7 / 2")) == List("5", "7", "2", "/", "+"))
1997cfcd6334 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
assert(syard(split("5 * 7 / 2")) == List("5", "7", "*", "2", "/"))