@@ -309,9 +309,6 @@ very very very long string
309
309
deindented
310
310
1
311
311
(lambda ()
312
- ; ; The indentation will fail in some cases if the syntax properties are
313
- ; ; not set. This only happens when font-lock fontifies the buffer.
314
- (font-lock-fontify-buffer )
315
312
(indent-region 1 (+ 1 (buffer-size ))))
316
313
indented)))
317
314
@@ -951,7 +948,7 @@ Convert the line-column information from that list into a buffer position value.
951
948
952
949
; ;; FIXME: Maybe add an ERT explainer function (something that shows the
953
950
; ;; surrounding code of the final point, not just the position).
954
- (defun rust-test-motion (source-code init-pos final-pos manip-func &optional & rest args )
951
+ (defun rust-test-motion (source-code init-pos final-pos manip-func &rest args )
955
952
" Test that MANIP-FUNC moves point from INIT-POS to FINAL-POS.
956
953
957
954
If ARGS are provided, send them to MANIP-FUNC.
@@ -960,12 +957,11 @@ INIT-POS, FINAL-POS are position symbols found in `rust-test-positions-alist'."
960
957
(with-temp-buffer
961
958
(rust-mode )
962
959
(insert source-code)
963
- (font-lock-fontify-buffer )
964
960
(goto-char (rust-get-buffer-pos init-pos))
965
961
(apply manip-func args)
966
962
(should (equal (point ) (rust-get-buffer-pos final-pos)))))
967
963
968
- (defun rust-test-region (source-code init-pos reg-beg reg-end manip-func &optional & rest args )
964
+ (defun rust-test-region (source-code init-pos reg-beg reg-end manip-func &rest args )
969
965
" Test that MANIP-FUNC marks region from REG-BEG to REG-END.
970
966
971
967
INIT-POS is the initial position of point.
@@ -974,7 +970,6 @@ All positions are position symbols found in `rust-test-positions-alist'."
974
970
(with-temp-buffer
975
971
(rust-mode )
976
972
(insert source-code)
977
- (font-lock-fontify-buffer )
978
973
(goto-char (rust-get-buffer-pos init-pos))
979
974
(apply manip-func args)
980
975
(should (equal (list (region-beginning ) (region-end ))
@@ -1377,24 +1372,6 @@ this_is_not_a_string();)"
1377
1372
" r\" this is a comment\n " font-lock-comment-face
1378
1373
" \" this is a string\" " font-lock-string-face )))
1379
1374
1380
- (ert-deftest font-lock-raw-string-constant ()
1381
- ; ; There was an issue in which a multi-line raw string would be fontified
1382
- ; ; correctly if inserted, but then incorrectly if one of the lines was then
1383
- ; ; edited. This test replicates how font-lock responds when text in the
1384
- ; ; buffer is modified in order to reproduce it.
1385
- (with-temp-buffer
1386
- (rust-mode )
1387
- (font-lock-fontify-buffer )
1388
- (insert " const BOO:&str = r#\"\n BOO\" #;" )
1389
- (beginning-of-buffer )
1390
- (insert " " )
1391
- (font-lock-after-change-function 1 2 0 )
1392
-
1393
- (should (equal 'font-lock-string-face (get-text-property 19 'face ))) ; ; Opening "r" of raw string
1394
- (should (equal 'font-lock-string-face (get-text-property 27 'face ))) ; ; Closing "#" of raw string
1395
- (should (equal nil (get-text-property 28 'face ))) ; ; Semicolon--should not be part of the string
1396
- ))
1397
-
1398
1375
(ert-deftest font-lock-runaway-raw-string ()
1399
1376
(rust-test-font-lock
1400
1377
" const Z = r#\" my raw string\" ;\n // oops this is still in the string"
@@ -2567,34 +2544,6 @@ type Foo<T> where T: Copy = Box<T>;
2567
2544
'(7 9 ))))
2568
2545
2569
2546
2570
- (ert-deftest font-lock-extend-region-in-string ()
2571
-
2572
- (with-temp-buffer
2573
- (rust-mode )
2574
- (insert "
2575
- fn foo() {
2576
- let x = r\"
2577
- Fontification needs to include this whole string or none of it.
2578
- \"
2579
- }" )
2580
- (font-lock-fontify-buffer )
2581
- (let ((font-lock-beg 13 )
2582
- (font-lock-end 42 ))
2583
- (rust-font-lock-extend-region)
2584
- (should (<= font-lock-beg 13 ))
2585
- (should (>= font-lock-end 106 ))
2586
- )
2587
- (let ((font-lock-beg 42 )
2588
- (font-lock-end 108 ))
2589
- (rust-font-lock-extend-region)
2590
- (should (<= font-lock-beg 25 ))
2591
- (should (>= font-lock-end 108 )))
2592
- (let ((font-lock-beg 1 )
2593
- (font-lock-end 12 ))
2594
- (rust-font-lock-extend-region)
2595
- (should (<= font-lock-beg 1 ))
2596
- (should (>= font-lock-end 12 )))))
2597
-
2598
2547
(ert-deftest redo-syntax-after-change-far-from-point ()
2599
2548
(let*
2600
2549
((tmp-file-name (make-temp-file " rust-mdoe-test-issue104" ))
@@ -2618,18 +2567,6 @@ Fontification needs to include this whole string or none of it.
2618
2567
)
2619
2568
)
2620
2569
2621
- (ert-deftest rust-test-revert-hook-preserves-point ()
2622
- (with-temp-buffer
2623
- ; ; Insert some code, and put point in the middle.
2624
- (insert " fn foo() {}\n " )
2625
- (insert " fn bar() {}\n " )
2626
- (insert " fn baz() {}\n " )
2627
- (goto-char (point-min ))
2628
- (forward-line 1 )
2629
- (let ((initial-point (point )))
2630
- (rust--after-revert-hook)
2631
- (should (equal initial-point (point ))))))
2632
-
2633
2570
(defun test-imenu (code expected-items )
2634
2571
(with-temp-buffer
2635
2572
(rust-mode )
0 commit comments