From f7e792faffe6d08c09d4d11f39be4265bb431256 Mon Sep 17 00:00:00 2001 From: darksnake Date: Fri, 2 Apr 2021 19:09:35 +0300 Subject: [PATCH] Add test for grid iteration. --- .../commonTest/kotlin/kaceince/kmath/real/GridTest.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kmath-for-real/src/commonTest/kotlin/kaceince/kmath/real/GridTest.kt b/kmath-for-real/src/commonTest/kotlin/kaceince/kmath/real/GridTest.kt index 91ee517ab..a7c4d30e2 100644 --- a/kmath-for-real/src/commonTest/kotlin/kaceince/kmath/real/GridTest.kt +++ b/kmath-for-real/src/commonTest/kotlin/kaceince/kmath/real/GridTest.kt @@ -15,4 +15,13 @@ class GridTest { assertEquals(6, grid.size) assertTrue { (grid - DoubleVector(0.0, 0.2, 0.4, 0.6, 0.8, 1.0)).norm < 1e-4 } } + + @Test + fun testIterateGrid(){ + var res = 0.0 + for(d in 0.0..1.0 step 0.2){ + res = d + } + assertEquals(1.0, res) + } } \ No newline at end of file