Debian Codegraph @

doc/tutorial_src/words_tests1.c

raw symbols SCIP
1 #include <cgreen/cgreen.h>
2
3 #include "words.h"
4 #include <string.h>
5
6 Describe(Words);
7 BeforeEach(Words) {}
8 AfterEach(Words) {}
9
10 Ensure(Words, returns_word_count) {
11 char *sentence = strdup("Birds of a feather");
12 int word_count = split_words(sentence);
13 assert_that(word_count, is_equal_to(4));
14 free(sentence);
15 }
16
17 TestSuite *words_tests() {
18 TestSuite *suite = create_test_suite();
19 add_test_with_context(suite, Words, returns_word_count);
20 return suite;
21 }