aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_consdiff.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-04-18 21:31:53 -0400
committerNick Mathewson <nickm@torproject.org>2017-04-18 21:31:53 -0400
commiteeb266c1395e582f1480f49316a5014ac77e8f50 (patch)
tree6117e4a2cdf77a81f81032816f1c57986da4c1b5 /src/test/test_consdiff.c
parent459643502b8958b44852d304cd1846d027628fc6 (diff)
parent5a7e39c0cbca3f2b94834167154472a61fc34a03 (diff)
downloadtor-eeb266c1395e582f1480f49316a5014ac77e8f50.tar.gz
tor-eeb266c1395e582f1480f49316a5014ac77e8f50.zip
Merge remote-tracking branches 'sebastian/consdiff_add' and 'sebastian/consdiff_newline'
Diffstat (limited to 'src/test/test_consdiff.c')
-rw-r--r--src/test/test_consdiff.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/test_consdiff.c b/src/test/test_consdiff.c
index 6c3a8e092c..91986161c9 100644
--- a/src/test/test_consdiff.c
+++ b/src/test/test_consdiff.c
@@ -622,6 +622,17 @@ test_consdiff_gen_ed_diff(void *arg)
tt_str_eq_line(".", smartlist_get(diff, 5));
tt_str_eq_line("2d", smartlist_get(diff, 6));
+ smartlist_clear(cons1);
+ smartlist_clear(cons2);
+ consensus_split_lines(cons1, "B\n", area);
+ consensus_split_lines(cons2, "A\nB\n", area);
+ diff = gen_ed_diff(cons1, cons2, area);
+ tt_ptr_op(NULL, OP_NE, diff);
+ tt_int_op(3, OP_EQ, smartlist_len(diff));
+ tt_str_eq_line("0a", smartlist_get(diff, 0));
+ tt_str_eq_line("A", smartlist_get(diff, 1));
+ tt_str_eq_line(".", smartlist_get(diff, 2));
+
/* TODO: small real use-cases, i.e. consensuses. */
done: