diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2017-04-17 06:46:23 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2017-04-17 06:49:27 +0200 |
commit | 459643502b8958b44852d304cd1846d027628fc6 (patch) | |
tree | c483d8d6dd12eeaa075660e736c9daaf031a82cd /src/test/test_consdiff.c | |
parent | b081a7ed21ae729f6e195715e130edaca3e0b7fe (diff) | |
download | tor-459643502b8958b44852d304cd1846d027628fc6.tar.gz tor-459643502b8958b44852d304cd1846d027628fc6.zip |
Don't accept ranges for add commands in consdiff
Fixes ticket #21963
Diffstat (limited to 'src/test/test_consdiff.c')
-rw-r--r-- | src/test/test_consdiff.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/test_consdiff.c b/src/test/test_consdiff.c index 1b4e2ad3c1..6c3a8e092c 100644 --- a/src/test/test_consdiff.c +++ b/src/test/test_consdiff.c @@ -687,6 +687,15 @@ test_consdiff_apply_ed_diff(void *arg) smartlist_clear(diff); + /* Unexpected range for add command. */ + smartlist_add_linecpy(diff, area, "1,2a"); + mock_clean_saved_logs(); + cons2 = apply_ed_diff(cons1, diff, 0); + tt_ptr_op(NULL, OP_EQ, cons2); + expect_single_log_msg_containing("add lines after a range"); + + smartlist_clear(diff); + /* Script is not in reverse order. */ smartlist_add_linecpy(diff, area, "1d"); smartlist_add_linecpy(diff, area, "3d"); |