public static void test_append() { Textblock tb = new Textblock(); Require(tb.Text == ""); tb.append("Hello"); Require(tb.Text == "Hello"); tb.append("{0}", 20); Require(tb.Text == "Hello20"); Ok(); }
public static void test_length() { Textblock tb = new Textblock(); string text = "1234567"; /* Add it 32 times to make sure that appending definitely works */ for (int i = 0; i < 32; i++) { tb.append(text); } /* Now make sure it's all right */ for (int i = 0; i < 32; i++) { int n = text.Length; int offset = i * n; //Original //Require(!memcmp(tb_text + offset, text, n)); Require(tb.Text.Substring(offset, n) == text); } Ok(); }