瀏覽代碼

test: add unit tests for the String class; they currently fail

because we actually have a bug!
legacy
Sam Hocevar sam 12 年之前
父節點
當前提交
a5cb244d1d
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. +2
    -0
      test/unit/string.cpp

+ 2
- 0
test/unit/string.cpp 查看文件

@@ -87,6 +87,7 @@ LOLUNIT_FIXTURE(StringTest)
String s1("ab"), s2("cd");

s1 += s2;
LOLUNIT_ASSERT_EQUAL(s1.Count(), 4);
LOLUNIT_ASSERT_EQUAL(s1[0], 'a');
LOLUNIT_ASSERT_EQUAL(s1[1], 'b');
LOLUNIT_ASSERT_EQUAL(s1[2], 'c');
@@ -94,6 +95,7 @@ LOLUNIT_FIXTURE(StringTest)
LOLUNIT_ASSERT_EQUAL(s1[4], '\0');

s2 += s2;
LOLUNIT_ASSERT_EQUAL(s2.Count(), 4);
LOLUNIT_ASSERT_EQUAL(s2[0], 'c');
LOLUNIT_ASSERT_EQUAL(s2[1], 'd');
LOLUNIT_ASSERT_EQUAL(s2[2], 'c');


Loading…
取消
儲存