Test Qt line number margin toggling

ober

cc2f12a309fea537f87a10b6932fc926b5ebed76

diff --git a/tests/test-qt-part2.ss b/tests/test-qt-part2.ss
index dc225c2..4e99a2f 100644
--- a/tests/test-qt-part2.ss
+++ b/tests/test-qt-part2.ss
@@ -85,7 +85,7 @@
          (w *qt-test-w*)
          (doc (sci-send ed SCI_GETDOCPOINTER))
          (buf (make-buffer name #f doc #f #f #f #f))
-         (win (make-qt-edit-window ed #f buf #f #f #f))
+         (win (make-qt-edit-window ed #f buf ed #f #f))
          (fr (make-qt-frame #f (make-split-leaf win) (list win) 0 #f))
          (app (new-app-state fr)))
     (sci-send ed SCI_SETREADONLY 0)
@@ -157,11 +157,16 @@
       (execute-command! app 'recenter)
       (check (sci-send ed SCI_GETFIRSTVISIBLELINE 0) => expected))))
 
-(test-case "group49 line-number toggle command is callable"
+(test-case "group49 line-number toggle changes Scintilla margin width"
   (let-values (((ed w app) (make-qt-test-app "part2-49")))
-    (execute-command! app 'toggle-line-numbers)
-    (execute-command! app 'toggle-line-numbers)
-    (check (string? (echo-state-message (app-state-echo app))) => #t)))
+    (let ((win (qt-current-window (app-state-frame app))))
+      (qt-line-number-area-set-visible! (qt-edit-window-line-number-area win) #t)
+      (check (sci-send ed SCI_GETMARGINWIDTHN 0) => 48)
+      (execute-command! app 'toggle-line-numbers)
+      (check (sci-send ed SCI_GETMARGINWIDTHN 0) => 0)
+      (execute-command! app 'toggle-line-numbers)
+      (check (sci-send ed SCI_GETMARGINWIDTHN 0) => 48)
+      (check (echo-state-message (app-state-echo app)) => "Line numbers ON"))))
 
 (test-case "group50 org template command remains registered"
   (check (find-command 'org-template-expand) ? procedure?))