| 33 | } |
| 34 | |
| 35 | static void eval_tests() { |
| 36 | struct hc_dsl dsl; |
| 37 | hc_dsl_init(&dsl, &hc_malloc_default); |
| 38 | hc_defer(hc_dsl_deinit(&dsl)); |
| 39 | struct hc_memory_stream out; |
| 40 | hc_memory_stream_init(&out, &hc_malloc_default); |
| 41 | hc_defer(hc_stream_deinit(&out.stream)); |
| 42 | dsl.out = &out.stream; |
| 43 | hc_dsl_set_string(&dsl, "foo", "ghi"); |
| 44 | hc_dsl_eval(&dsl, "abc $(print (upcase foo)) def"); |
| 45 | assert(strcmp("abc GHI def", hc_memory_stream_string(&out)) == 0); |
| 46 | } |
| 47 | |
| 48 | void dsl_tests() { |
| 49 | read_id_tests(); |
no test coverage detected