diff options
| author | Felix S Klock II <pnkfelix@pnkfx.org> | 2015-06-10 17:41:08 +0200 |
|---|---|---|
| committer | Felix S Klock II <pnkfelix@pnkfx.org> | 2015-06-10 17:41:08 +0200 |
| commit | 5ed467549abe81415241b0ea45e2ae87584b588c (patch) | |
| tree | 9897c7a87d639c014f0b78024600933ac0a975b6 /rust-mode-tests.el | |
| parent | 86db9bdb55e9812425f4c9ece47b1bc2b5dd836b (diff) | |
| parent | 9d773b42d7345d8402426eb89070e0f374031d44 (diff) | |
| download | rust-mode-5ed467549abe81415241b0ea45e2ae87584b588c.tar.gz | |
Merge pull request #73 from MicahChalmer/raw-string-multiline-edit-fix
Fix multi-line raw strings when editing
Diffstat (limited to 'rust-mode-tests.el')
| -rw-r--r-- | rust-mode-tests.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el index bb40781..b40aed0 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -1067,6 +1067,24 @@ this_is_not_a_string();)" "r\" this is a comment\n" font-lock-comment-face "\"this is a string\"" font-lock-string-face))) +(ert-deftest font-lock-raw-string-constant () + ;; There was an issue in which a multi-line raw string would be fontified + ;; correctly if inserted, but then incorrectly if one of the lines was then + ;; edited. This test replicates how font-lock responds when text in the + ;; buffer is modified in order to reproduce it. + (with-temp-buffer + (rust-mode) + (font-lock-fontify-buffer) + (insert "const BOO:&str = r#\"\nBOO\"#;") + (beginning-of-buffer) + (insert " ") + (font-lock-after-change-function 1 2 0) + + (should (equal 'font-lock-string-face (get-text-property 19 'face))) ;; Opening "r" of raw string + (should (equal 'font-lock-string-face (get-text-property 27 'face))) ;; Closing "#" of raw string + (should (equal nil (get-text-property 28 'face))) ;; Semicolon--should not be part of the string + )) + (ert-deftest indent-method-chains-no-align () (let ((rust-indent-method-chain nil)) (test-indent " |
