33void test_call (struct vunit_test_ctx * ctx ) {
44 char * out = NULL ;
55
6- vunit_run_vinumc_ok (ctx , "[return_arg test]\n" , & out , "--with" ,
6+ vunit_run_vinumc_ok (ctx , "[return_text test]\n" , & out , "--with" ,
77 "subprojects/vinumc/tests/libtestlib.so" , NULL );
88
99 VUNIT_ASSERT_STREQ (ctx , out , "test" );
1010}
1111
12+ void test_arg_call (struct vunit_test_ctx * ctx ) {
13+ char * out = NULL ;
14+
15+ vunit_run_vinumc_ok (ctx ,
16+ "[hello: world!]\n"
17+ "[return_text hello]\n"
18+ "[return_call hello]\n" ,
19+ & out , "--with" , "subprojects/vinumc/tests/libtestlib.so" , NULL );
20+
21+ VUNIT_ASSERT_STREQ (ctx , out , "helloworld!" );
22+ }
23+
24+ void test_arg_by_index (struct vunit_test_ctx * ctx ) {
25+ char * out = NULL ;
26+
27+ vunit_run_vinumc_ok (ctx ,
28+ "[invert [a:2][b:1]]\n" ,
29+ & out , "--with" , "subprojects/vinumc/tests/libtestlib.so" , NULL );
30+
31+ VUNIT_ASSERT_STREQ (ctx , out , "1 2" );
32+ }
33+
1234void test_nested_call (struct vunit_test_ctx * ctx ) {
1335 char * out = NULL ;
1436
1537 vunit_run_vinumc_ok (ctx ,
16- "[a: This is a [return_arg Test!]!]\n"
38+ "[a: This is a [return_text Test!]!]\n"
1739 "[a]\n" ,
1840 & out , "--with" , "subprojects/vinumc/tests/libtestlib.so" , NULL );
1941
@@ -23,7 +45,7 @@ void test_nested_call(struct vunit_test_ctx *ctx) {
2345void test_empty_nested_call (struct vunit_test_ctx * ctx ) {
2446 char * out = NULL ;
2547
26- vunit_run_vinumc_ok (ctx , "[return_arg [return_arg [return_arg ]]]" , & out , "--with" ,
48+ vunit_run_vinumc_ok (ctx , "[return_text [return_text [return_text ]]]" , & out , "--with" ,
2749 "subprojects/vinumc/tests/libtestlib.so" , NULL );
2850
2951 VUNIT_ASSERT_STREQ (ctx , out , "" );
@@ -40,6 +62,8 @@ void test_call_no_args(struct vunit_test_ctx *ctx) {
4062
4163struct vunit_test tests [] = {
4264 { .name = "Test extern library call" , .test_func = test_call },
65+ { .name = "Test extern library get by index" , .test_func = test_arg_by_index },
66+ { .name = "Test extern library call get text and get arg" , .test_func = test_arg_call },
4367 { .name = "Test extern library call inside call" , .test_func = test_nested_call },
4468 { .name = "Test nested empty library calls" , .test_func = test_empty_nested_call },
4569 {
0 commit comments