+class PatternMatchingTests usingPlatform: platform testFramework: minitest = NewspeakObject (
+"Tests for Newspeaks pattern matching facilities."|
+ private TestContext = minitest TestContext.
+class SimplificationTests = TestContext (|
+class Product of: l and: r = (|
+ ^ p multiply: lhs with: rhs
+ case: <multiply: ?x with: <num: 1>> => [ x ]
+ result = simplify: three. |
+ assert: result = three.
+testSimplificationForMultiplicationIdentity = (
+ product = Product of: lhs and: rhs.
+ result = simplify: product. |
+)) : ('as yet unclassified'