- Timestamp:
- 08/14/09 09:02:07 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/rv_test.cpp
r477 r528 7 7 8 8 TEST ( test_rv ) { 9 RV a = RV ( "{a }", "3" );9 RV a = RV ( "{a_in_test_rv }", "3" ); 10 10 CHECK_EQUAL ( 1, a.length() ); 11 11 CHECK_EQUAL ( 3, a.size ( 0 ) ); 12 CHECK_EQUAL ( std::string ( "a " ), a.name ( 0 ) );12 CHECK_EQUAL ( std::string ( "a_in_test_rv" ), a.name ( 0 ) ); 13 13 14 RV b = RV ( "{b }", "2" );14 RV b = RV ( "{b_in_test_rv }", "2" ); 15 15 CHECK_EQUAL ( 0, b.mint() ); 16 16 17 RV c = RV ( "{c }" );17 RV c = RV ( "{c_in_test_rv }" ); 18 18 CHECK_EQUAL ( 1, c.length() ); 19 19 CHECK_EQUAL ( 1, c.size ( 0 ) ); 20 20 21 RV trv = RV ( "{e f}", "1 2", "3 4" );21 RV trv = RV ( "{e_in_test_rv f_in_test_rv }", "1 2", "3 4" ); 22 22 CHECK_EQUAL ( 2, trv.length() ); 23 23 CHECK_EQUAL ( 3, trv.mint() ); … … 29 29 CHECK_EQUAL ( 2, ab.length() ); 30 30 CHECK_EQUAL ( 3, ab.size ( 0 ) ); 31 CHECK_EQUAL ( std::string ( "a " ), ab.name ( 0 ) );31 CHECK_EQUAL ( std::string ( "a_in_test_rv" ), ab.name ( 0 ) ); 32 32 CHECK_EQUAL ( 2, ab.size ( 1 ) ); 33 CHECK_EQUAL ( std::string ( "b " ), ab.name ( 1 ) );33 CHECK_EQUAL ( std::string ( "b_in_test_rv" ), ab.name ( 1 ) ); 34 34 35 35 std::stringstream abss; 36 36 abss << ab; 37 CHECK_EQUAL ( std::string ( "1(3)=a_ {0}; 2(2)=b_{0}; " ), abss.str() );37 CHECK_EQUAL ( std::string ( "1(3)=a_in_test_rv_{0}; 2(2)=b_in_test_rv_{0}; " ), abss.str() ); 38 38 39 39 // concat a, b and c … … 42 42 std::stringstream abcss; 43 43 abcss << abc; 44 CHECK_EQUAL ( std::string ( "1(3)=a_ {0}; 2(2)=b_{0}; 3(1)=c_{0}; " ), abcss.str() );44 CHECK_EQUAL ( std::string ( "1(3)=a_in_test_rv_{0}; 2(2)=b_in_test_rv_{0}; 3(1)=c_in_test_rv_{0}; " ), abcss.str() ); 45 45 46 46 // structure of a, b, c … … 58 58 CHECK_EQUAL ( 1, slice.length() ); 59 59 CHECK_EQUAL ( 3, slice.size ( 0 ) ); 60 CHECK_EQUAL ( std::string ( "a " ), slice.name ( 0 ) );60 CHECK_EQUAL ( std::string ( "a_in_test_rv" ), slice.name ( 0 ) ); 61 61 62 62 // find a in abc … … 79 79 std::stringstream acss; 80 80 acss << ac; 81 CHECK_EQUAL ( std::string ( "1(3)=a_ {0}; 3(1)=c_{0}; " ), acss.str() );81 CHECK_EQUAL ( std::string ( "1(3)=a_in_test_rv_{0}; 3(1)=c_in_test_rv_{0}; " ), acss.str() ); 82 82 83 83 // data index of ac in abc