Explorar el Código

Extended tests for Integer class

- added test for "parse" method
Patrick hace 4 años
padre
commit
beffe24b9e
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  1. 11 0
      test/cases/boxing/IntegerTest.cpp

+ 11 - 0
test/cases/boxing/IntegerTest.cpp

@@ -88,4 +88,15 @@ namespace
     ASSERT_EQ(3, x / y / 3);
     ASSERT_EQ(1, 19 / 10);
   }
+
+  TEST_F(IntegerTest, parse)
+  {
+    ls_std::Integer x {};
+
+    x.parse("1989");
+    ASSERT_EQ(1989, x);
+
+    x.parse("-17");
+    ASSERT_EQ(-17, x);
+  }
 }