From: Michael D. Lowis Date: Thu, 12 Jan 2017 13:38:32 +0000 (-0500) Subject: Fixed unit tests that broke due to copy paste behavior change X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=12e3657a3c53e7920f6890fdf77d51442703a266;p=projs%2Ftide.git Fixed unit tests that broke due to copy paste behavior change --- diff --git a/TODO.md b/TODO.md index 347441c..ec644ad 100644 --- a/TODO.md +++ b/TODO.md @@ -2,6 +2,7 @@ Up Next: +* Add keyboard shortcut to highlight the thing under the cursor * Implement X Selection protocol for handling clipboard and primary selections * Tag line count should account for wrapped lines * ctrl+alt+f should find next occurence of previous search term diff --git a/tests/xedit.c b/tests/xedit.c index d73bd82..7d8a898 100644 --- a/tests/xedit.c +++ b/tests/xedit.c @@ -457,7 +457,7 @@ TEST_SUITE(XeditTests) { send_keys(ModCtrl, 'x'); getview(EDIT)->selection = (Sel){ 4, 4, 0 }; send_keys(ModCtrl, 'v'); - CHECK(getsel(EDIT)->beg == 12); + CHECK(getsel(EDIT)->beg == 4); CHECK(getsel(EDIT)->end == 12); CHECK(verify_text(EDIT, "baz\r\nfoo\r\nbar\r\n")); } @@ -469,7 +469,7 @@ TEST_SUITE(XeditTests) { send_keys(ModCtrl, 'c'); getview(EDIT)->selection = (Sel){ 12, 12, 0 }; send_keys(ModCtrl, 'v'); - CHECK(getsel(EDIT)->beg == 20); + CHECK(getsel(EDIT)->beg == 12); CHECK(getsel(EDIT)->end == 20); CHECK(verify_text(EDIT, "foo\r\nbar\r\nbaz\r\nfoo\r\nbar\r\n")); } @@ -741,7 +741,7 @@ TEST_SUITE(XeditTests) { exec("Cut"); getview(EDIT)->selection = (Sel){ 4, 4, 0 }; exec("Paste"); - CHECK(getsel(EDIT)->beg == 12); + CHECK(getsel(EDIT)->beg == 4); CHECK(getsel(EDIT)->end == 12); CHECK(verify_text(EDIT, "baz\r\nfoo\r\nbar\r\n")); } @@ -752,7 +752,7 @@ TEST_SUITE(XeditTests) { exec("Copy"); getview(EDIT)->selection = (Sel){ 12, 12, 0 }; exec("Paste"); - CHECK(getsel(EDIT)->beg == 20); + CHECK(getsel(EDIT)->beg == 12); CHECK(getsel(EDIT)->end == 20); CHECK(verify_text(EDIT, "foo\r\nbar\r\nbaz\r\nfoo\r\nbar\r\n")); }