failing test noentry; good
This commit is contained in:
@@ -11,6 +11,27 @@ int main(void) {
|
||||
struct journal j = journal();
|
||||
struct sources s = sources(&j);
|
||||
if(errno) goto catch;
|
||||
|
||||
const union line64 agenda = {{4,{{20,04,1996}}}},
|
||||
before = {{1,{{1,1,1900}}}},
|
||||
noentry = {{3,{{1,6,1995}}}};
|
||||
const struct source *source;
|
||||
|
||||
source = source_lookup(&s, agenda);
|
||||
printf("agenda: <%.*s>\n",
|
||||
(int)(source->name.b - source->name.a), source->name.a);
|
||||
assert(pair_is_string(source->name, "1995agenda"));
|
||||
|
||||
source = source_lookup(&s, before);
|
||||
printf("before: <%.*s>\n",
|
||||
(int)(source->name.b - source->name.a), source->name.a);
|
||||
assert(pair_is_string(source->name, 0));
|
||||
|
||||
source = source_lookup(&s, noentry);
|
||||
printf("noentry: <%.*s>\n",
|
||||
(int)(source->name.b - source->name.a), source->name.a);
|
||||
assert(pair_is_string(source->name, 0));
|
||||
|
||||
goto finally;
|
||||
catch:
|
||||
success = EXIT_FAILURE, perror("source");
|
||||
|
||||
Reference in New Issue
Block a user