@@ -2549,24 +2549,21 @@ Insert KEY if there's no command."
2549
2549
lispy--eval-cond-msg))))
2550
2550
2551
2551
(ert-deftest lispy-eval-other-window ()
2552
- (setq lispy--eval-sym nil)
2553
- (should (string= (lispy-with-v el "(dolist |(s '(1 2 3))\n (message \"val: %d\" s))"
2554
- (lispy-eval-other-window)) "1"))
2555
- (should (string= (lispy-with-v el "(dolist |(s '(1 2 3))\n (message \"val: %d\" s))"
2556
- (lispy-eval-other-window)) "2"))
2557
- (should (string= (lispy-with-v el "(dolist |(s '(1 2 3))\n (message \"val: %d\" s))"
2558
- (lispy-eval-other-window)) "3"))
2559
- (should (string= (lispy-with-v el "(dolist |(s '(1 2 3))\n (message \"val: %d\" s))"
2560
- (lispy-eval-other-window)) "nil"))
2561
- (should (string= (lispy-with-v el "(dolist |(s '(1 2 3))\n (message \"val: %d\" s))"
2562
- (lispy-eval-other-window)) "1"))
2563
- (setq lispy--eval-sym nil)
2564
- (should (string= (lispy-with-v el "(mapcar |(lambda (s) (* s s)) '(1 2))"
2565
- (lispy-eval-other-window)) "1"))
2566
- (should (string= (lispy-with-v el "(mapcar |(lambda (s) (* s s)) '(1 2))"
2567
- (lispy-eval-other-window)) "2"))
2568
- (should (string= (lispy-with-v el "(mapcar |(lambda (s) (* s s)) '(1 2))"
2569
- (lispy-eval-other-window)) "nil")))
2552
+ (unless noninteractive
2553
+ (cl-labels ((p (keys)
2554
+ (setq s nil)
2555
+ (setq unread-command-events (listify-key-sequence (kbd keys)))
2556
+ (lispy-eval-other-window)))
2557
+ (should (string= (lispy-with-v el "(dolist |(s '(1 2 3))\n (message \"val: %d\" s))"
2558
+ (p "C-m")) "1"))
2559
+ (should (string= (lispy-with-v el "(dolist |(s '(1 2 3))\n (message \"val: %d\" s))"
2560
+ (p "C-n C-m")) "2"))
2561
+ (should (string= (lispy-with-v el "(dolist |(s '(1 2 3))\n (message \"val: %d\" s))"
2562
+ (p "C-n C-n C-m")) "3"))
2563
+ (should (string= (lispy-with-v el "(mapcar |(lambda (s) (* s s)) '(1 2))"
2564
+ (p "C-m")) "1"))
2565
+ (should (string= (lispy-with-v el "(mapcar |(lambda (s) (* s s)) '(1 2))"
2566
+ (p "C-n C-m")) "2")))))
2570
2567
2571
2568
(ert-deftest lispy-ace-char ()
2572
2569
(should (string= (lispy-with "|(cons 'norwegian 'blue)"
0 commit comments