From f98536eef5b24bf98730c3b555aeb63ed9de0927 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 3 Oct 2010 10:49:42 +0000 Subject: SCI: Allow multiple word groups in parser In SCI01 and up, each typed word may be interpreted as multiple class,group pairs. This patch adds support to the vocabulary and parser. It uses the matcher support added in r52985. This fixes parser issues in German LSL3, but needs testing. svn-id: r52989 --- test/common/array.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test/common') diff --git a/test/common/array.h b/test/common/array.h index c85e056b19..f17edd3984 100644 --- a/test/common/array.h +++ b/test/common/array.h @@ -78,6 +78,36 @@ class ArrayTestSuite : public CxxTest::TestSuite TS_ASSERT_EQUALS(array.size(), (unsigned int)5); } + void test_insert_at_array() { + Common::Array array; + Common::Array array2; + + // First of all some data + array.push_back(-12); + array.push_back(17); + array.push_back(25); + array.push_back(-11); + + array2.push_back(42); + array2.push_back(105); + array2.push_back(-1); + + // Insert some data + array.insert_at(2, array2); + + TS_ASSERT_EQUALS(array.size(), (unsigned int)7); + + TS_ASSERT_EQUALS(array[0], -12); + TS_ASSERT_EQUALS(array[1], 17); + TS_ASSERT_EQUALS(array[2], 42); + TS_ASSERT_EQUALS(array[3], 105); + TS_ASSERT_EQUALS(array[4], -1); + TS_ASSERT_EQUALS(array[5], 25); + TS_ASSERT_EQUALS(array[6], -11); + + } + + void test_remove_at() { Common::Array array; -- cgit v1.2.3