From 9e3de31f0ea686c2bb5322a959d6e876043f5a31 Mon Sep 17 00:00:00 2001
From: ronanM
Date: Wed, 7 Dec 2016 15:50:13 +0100
Subject: [PATCH 1/2] Example of TypeCheckedTripleEquals mixed in a test class
---
app/views/userGuide/usingMatchers.scala.html | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/app/views/userGuide/usingMatchers.scala.html b/app/views/userGuide/usingMatchers.scala.html
index 27b52bbbec..d395139a2f 100644
--- a/app/views/userGuide/usingMatchers.scala.html
+++ b/app/views/userGuide/usingMatchers.scala.html
@@ -204,6 +204,23 @@ Checking equality with matchers
the equality constraints provided by TypeCheckedTripleEquals
, however, the statement fails to compile. For more information
and examples, see the main documentation for trait TypeCheckedTripleEquals
.
+An example of TypeCheckedTripleEquals mixed in a test class:
+
+
+import org.scalatest._
+import org.scalactic.TypeCheckedTripleEquals
+
+class MyTest extends FunSuite with Matchers with TypeCheckedTripleEquals {
+
+ test("Type checked ===") {
+ val i : Int = 42
+ val s : String = "42"
+
+ i should === (s) // Do not compile because i is an Int and s is a String, great !
+ }
+}
+
+
Checking size and length
From ae7a079340aebd358e9384a775ccd6ab374898ea Mon Sep 17 00:00:00 2001
From: ronanM
Date: Wed, 7 Dec 2016 15:58:22 +0100
Subject: [PATCH 2/2] Update usingMatchers.scala.html
---
app/views/userGuide/usingMatchers.scala.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/userGuide/usingMatchers.scala.html b/app/views/userGuide/usingMatchers.scala.html
index d395139a2f..e9311e5289 100644
--- a/app/views/userGuide/usingMatchers.scala.html
+++ b/app/views/userGuide/usingMatchers.scala.html
@@ -213,8 +213,8 @@ Checking equality with matchers
class MyTest extends FunSuite with Matchers with TypeCheckedTripleEquals {
test("Type checked ===") {
- val i : Int = 42
- val s : String = "42"
+ val i: Int = 42
+ val s: String = "42"
i should === (s) // Do not compile because i is an Int and s is a String, great !
}