pre_marking2/docdiff_test2.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Mon, 08 Nov 2021 02:16:33 +0000
changeset 409 0e55b6313adc
parent 382 1bd800376e0c
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
283
ef5f62bf5987 updated
Christian Urban <urbanc@in.tum.de>
parents: 227
diff changeset
     2
import CW7a._
227
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
assert(occurrences(List("a", "b", "b", "c", "d")) == Map("a" -> 1, "b" -> 2, "c" -> 1, "d" -> 1))
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
b5f3e814a710 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
assert(occurrences(List("d", "b", "d", "b", "d")) == Map("d" -> 3, "b" -> 2))
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
     7
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
     8
assert(occurrences(List("b", "b", "b", "b", "b")) == Map("b" -> 5))
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
     9
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 283
diff changeset
    10
assert(occurrences(Nil) == Map())