summaryrefslogtreecommitdiff
path: root/Test/triggers/suppressing-warnings-behaves-properly.dfy
diff options
context:
space:
mode:
authorGravatar Clément Pit--Claudel <clement.pitclaudel@live.com>2015-08-28 20:39:02 -0700
committerGravatar Clément Pit--Claudel <clement.pitclaudel@live.com>2015-08-28 20:39:02 -0700
commit2db858bf6e72e521b49aa0ae3a993dc943b8c875 (patch)
tree692ebe07028e35e431e8b93ee35266461126d5cd /Test/triggers/suppressing-warnings-behaves-properly.dfy
parent3b1c3923a403efbd28b8f5ae6fc4429ccee8c2e8 (diff)
Implement {:nowarn}, clarify some messages, and add a few tests
Diffstat (limited to 'Test/triggers/suppressing-warnings-behaves-properly.dfy')
-rw-r--r--Test/triggers/suppressing-warnings-behaves-properly.dfy21
1 files changed, 21 insertions, 0 deletions
diff --git a/Test/triggers/suppressing-warnings-behaves-properly.dfy b/Test/triggers/suppressing-warnings-behaves-properly.dfy
new file mode 100644
index 00000000..237269e5
--- /dev/null
+++ b/Test/triggers/suppressing-warnings-behaves-properly.dfy
@@ -0,0 +1,21 @@
+// RUN: %dafny /compile:0 /print:"%t.print" /dprint:"%t.dprint" /autoTriggers:1 /printTooltips "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+// This file checks that suppressing warnings works properly
+
+predicate f(x: int)
+predicate g(x: int)
+
+method M() {
+ assert forall n :: n >= 0 || n < 0;
+ assert forall n {:nowarn} :: n >= 0 || n < 0;
+ assert forall n {:autotriggers false} :: n >= 0 || n < 0;
+
+ assert forall n: nat :: (n != 0) == f(n) || true;
+ assert forall n: nat {:nowarn} :: (n != 0) == f(n) || true;
+ assert forall n: nat {:autotriggers false} :: (n != 0) == f(n) || true;
+
+ assert forall n: nat :: f(n) == f(n+1) || g(n) || true;
+ assert forall n: nat {:nowarn} :: (n != 0) == f(n) || true;
+ assert forall n: nat {:autotriggers false} :: (n != 0) == f(n) || true;
+}