(forward-sexp)
(should (= (point) 21)))
+(ert-deftest top-level-thread-id ()
+ "Test obtaining the thread id of a top-level on startup."
+ (let ((buf-name (generate-new-buffer-name "*test top-level*")))
+ (sweeprolog-top-level buf-name)
+ (should sweeprolog-top-level-thread-id)
+ (sweeprolog-top-level-delete-process buf-name)
+ (kill-buffer buf-name)))
+
(sweeprolog-deftest usage-example-comment ()
"Tests adding usage example comments."
"\nfoo."
(let* ((proc (get-buffer-process buf))
(tty (process-tty-name proc)))
(process-send-eof proc)
- (sweeprolog--query-once "sweep" "sweep_top_level_start_pty" tty)
- (unless comint-last-prompt buf (accept-process-output proc 1))
- (when (eq system-type 'gnu/linux)
- ;; make sure the pty does not echo input
- (call-process "stty" nil nil nil "-F" tty "-echo"))))
+ (prog1 (sweeprolog--query-once
+ "sweep" "sweep_top_level_start_pty" tty)
+ (unless comint-last-prompt buf
+ (accept-process-output proc 1))
+ (when (eq system-type 'gnu/linux)
+ ;; make sure the pty does not echo input
+ (call-process "stty" nil nil nil "-F" tty "-echo")))))
(unless sweeprolog-prolog-server-port
(sweeprolog-start-prolog-server))
(make-comint-in-buffer "sweeprolog-top-level"