]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.gadgets.charts.lines: add a division by zero test for calc-line-slope
authorAlexander Iljin <ajsoft@yandex.ru>
Wed, 8 Feb 2017 18:57:30 +0000 (21:57 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 17 Apr 2017 20:54:51 +0000 (13:54 -0700)
extra/ui/gadgets/charts/lines/lines-tests.factor

index 9b50cb79526279ff751d31602762312da1767427..e3c71a6ba5d2cd32451c73e5dfb3fb26f2fed954 100644 (file)
@@ -1,10 +1,12 @@
 ! Copyright (C) 2017 Alexander Ilin.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel math sequences tools.test ui.gadgets.charts.lines
-ui.gadgets.charts.lines.private ui.gadgets.charts.utils ;
+USING: kernel math math.ratios sequences tools.test
+ui.gadgets.charts.lines ui.gadgets.charts.lines.private
+ui.gadgets.charts.utils ;
 IN: ui.gadgets.charts.lines.tests
 
 { -2/3 } [ { 1 3 } { -2 5 } calc-line-slope ] unit-test
+[ { 5 0 } { 5 5 } calc-line-slope ] [ division-by-zero? ] must-fail-with
 { 3 } [ -2/3 1 { 1 3 } calc-y ] unit-test
 { 5 } [ -2/3 -2 { 1 3 } calc-y ] unit-test
 { 3 } [ -2/3 1 { -2 5 } calc-y ] unit-test