From fad74b96e5d9367960358b1c4cc9c2cce79e961a Mon Sep 17 00:00:00 2001 From: Michael Lowell Roberts Date: Wed, 8 Jul 2015 11:01:11 -0700 Subject: added unit tests for exclusive refinement. --- Test/irondafny0/inheritreqs1.dfy | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Test/irondafny0/inheritreqs1.dfy (limited to 'Test/irondafny0/inheritreqs1.dfy') diff --git a/Test/irondafny0/inheritreqs1.dfy b/Test/irondafny0/inheritreqs1.dfy new file mode 100644 index 00000000..c83d04ac --- /dev/null +++ b/Test/irondafny0/inheritreqs1.dfy @@ -0,0 +1,22 @@ +// RUN: %dafny /compile:3 /optimize /print:"%t.print" /dprint:"%t.dprint" "%s" > "%t" +// RUN: %diff "%s.expect" "%t" + +abstract module Spec { + method Greet(b: bool) + requires b; +} + +module Impl refines Spec { + method Greet(b: bool) { + print "o hai!\n"; + } + + method Xyzzy(b: bool) + requires b; + {} + + method Main() { + Greet(true); + Xyzzy(false); + } +} -- cgit v1.2.3