test/csv_test.rb in openwferu-0.9.6 vs test/csv_test.rb in openwferu-0.9.7
- old
+ new
@@ -237,9 +237,66 @@
wi.fx = "A"
wi.fy = "b"
do_test(CSV5, wi, { "fX" => "true", "fY" => "false" }, false)
end
+ #
+ # TEST 6
+
+ CSV6 = \
+"""
+,
+in:fx, out:fy
+,
+<10,a
+<=100,b
+,c
+"""
+
+ def test_csv_6
+
+ wi = InFlowWorkItem.new()
+
+ wi.fx = "5"
+ do_test(CSV6, wi, { "fy" => "a" }, false)
+
+ wi.attributes.clear()
+
+ wi.fx = "100.0001"
+ do_test(CSV6, wi, { "fy" => "c" }, false)
+ end
+
+ #
+ # TEST 7
+
+ CSV7 = \
+"""
+,
+in:fx, out:fy
+,
+>100,a
+>=10,b
+,c
+"""
+
+ def test_csv_7
+
+ wi = InFlowWorkItem.new()
+
+ wi.fx = "5"
+ do_test(CSV7, wi, { "fy" => "c" }, false)
+
+ wi.attributes.clear()
+
+ wi.fx = "10"
+ do_test(CSV7, wi, { "fy" => "b" }, false)
+
+ wi.attributes.clear()
+
+ wi.fx = "10a"
+ do_test(CSV7, wi, { "fy" => "a" }, false)
+ end
+
protected
def do_test (table_data, wi, expected_result, verbose=false)
table = CsvTable.new(table_data)