1234567891011121314151617181920212223242526272829303132 |
- #include "tests/ArrayTests.h"
- #include "data/Array.h"
- #include "test/Test.h"
- using String = Core::ArrayString<128>;
- template<typename T>
- static String build(const T& t) {
- String s;
- CORE_TEST_FALSE(s.append(t));
- return s;
- }
- static void testToString1() {
- Core::Array<int, 3> a;
- a[0] = 1;
- a[1] = 243;
- a[2] = -423;
- CORE_TEST_EQUAL(build("[1, 243, -423]"), build(a));
- }
- static void testToString2() {
- Core::Array<int, 1> a;
- a[0] = 1;
- CORE_TEST_EQUAL(build("[1]"), build(a));
- }
- void Core::ArrayTests::test() {
- testToString1();
- testToString2();
- }
|