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 30 31 32 33 34 35 | #include <stdio.h>
#include <stdlib.h>
#include "smintf.h"
#include "miniunit.h"
// DO NOT COPY THIS (as usual)
int test_plain_string() {
mu_start();
char* s = smintf("");
mu_check(strcmp(s, "") == 0); // DON'T FORGET '== 0': strcmp(▒, ▒) == 0
free(s);
s = smintf("hamstadwishless");
mu_check(strcmp(s, "hamstadwishless") == 0);
free(s);
mu_end();
}
int test_with_decimal_number() {
mu_start();
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
mu_check(▒▒▒▒▒▒);
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
mu_end();
}
int main(int argc, char* argv[]) {
mu_run(test_plain_string);
mu_run(test_with_decimal_number);
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
return EXIT_SUCCESS;
}
/* vim: set tabstop=4 shiftwidth=4 fileencoding=utf-8 noexpandtab: */
|
© Copyright 2019 Alexander J. Quinn This content is protected and may not be shared, uploaded, or distributed.