From 074172a069d77888f232d44660b72e07579296ae Mon Sep 17 00:00:00 2001 From: qunyanm Date: Fri, 1 Apr 2016 14:36:56 -0700 Subject: Fix issue 148. The results for sign comparison for BigRational.CompareTo was wrong. --- Test/dafny4/Bug148.dfy | 25 +++++++++++++++++++++++++ Test/dafny4/Bug148.dfy.expect | 17 +++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 Test/dafny4/Bug148.dfy create mode 100644 Test/dafny4/Bug148.dfy.expect (limited to 'Test') diff --git a/Test/dafny4/Bug148.dfy b/Test/dafny4/Bug148.dfy new file mode 100644 index 00000000..b7a08952 --- /dev/null +++ b/Test/dafny4/Bug148.dfy @@ -0,0 +1,25 @@ +// RUN: %dafny /compile:3 "%s" > "%t" +// RUN: %diff "%s.expect" "%t" + +method Main() +{ + var zero : real := 0.0; + var three : real := 3.0; + var fifteen : real := 15.0; + var negone : real := -1.0; + var negthree : real := -3.0; + + print zero <= fifteen, "\n"; // true + print fifteen <= zero, "\n"; // false + print negone <= zero, "\n"; // true + print zero <= negone, "\n"; // false + print negone <= fifteen, "\n"; // true + print fifteen <= negone, "\n"; // false + + print zero >= fifteen, "\n"; // false + print fifteen >= zero, "\n"; // true + print negone >= zero, "\n"; // false + print zero >= negone, "\n"; // true + print negone >= fifteen, "\n"; // false + print fifteen >= negone, "\n"; // true +} diff --git a/Test/dafny4/Bug148.dfy.expect b/Test/dafny4/Bug148.dfy.expect new file mode 100644 index 00000000..7acfb169 --- /dev/null +++ b/Test/dafny4/Bug148.dfy.expect @@ -0,0 +1,17 @@ + +Dafny program verifier finished with 2 verified, 0 errors +Program compiled successfully +Running... + +True +False +True +False +True +False +False +True +False +True +False +True -- cgit v1.2.3