1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>

int _test_parse_string() {
    mu_start();
    //────────────────────
    
    // Declare and initialize two variables, called input and pos.
    ▒▒▒▒▒▒▒▒input = ▒▒▒▒▒▒▒▒▒▒▒▒;  // #1
    assert(strlen(input) == 5);
    ▒▒▒▒▒▒▒▒pos = ▒▒▒▒▒▒▒▒▒▒▒▒;  // #2
    char* result_str;
    bool did_succeed = parse_string(&result_str, &pos);
    mu_check(did_succeed);
    if(did_succeed) {
        mu_check_strings_equal(result_str, "xyz");
        mu_check(▒▒▒▒▒▒▒ pos ▒▒▒▒▒▒▒);   // #3: Check that pos is in right
    }                                     //  position (relative to input).
    
    //────────────────────
    mu_end();
}
int main(int argc, char* argv[]) {

    return EXIT_SUCCESS;
}
/* vim: set tabstop=4 shiftwidth=4 fileencoding=utf-8 noexpandtab: */

© Copyright 2024 Alexander J. Quinn         This content is protected and may not be shared, uploaded, or distributed.