@@ -410,4 +410,58 @@ Also should respect 10 column fill."
410410 (string= " hello world"
411411 (buffer-substring 1 (point-max ))))))
412412
413+ (ert-deftest forward-sexp-function-1 ()
414+ " Check if `forward-sexp-function' behaves properly on end of
415+ sexp."
416+ (should (with-temp-buffer
417+ (haskell-mode )
418+ (insert " (foo) bar" )
419+ (goto-char 5 )
420+ (condition-case err
421+ (progn (forward-sexp )
422+ nil )
423+ (scan-error (equal (cddr err) (list 5 6 )))))))
424+
425+ (ert-deftest forward-sexp-function-2 ()
426+ " Check if `forward-sexp-function' behaves properly on beginning
427+ of sexp."
428+ (should (with-temp-buffer
429+ (haskell-mode )
430+ (insert " (foo) bar" )
431+ (goto-char 1 )
432+ (forward-sexp )
433+ (eq (point ) 6 ))))
434+
435+ (ert-deftest haskell-forward-sexp-1 ()
436+ " Check if `haskell-forward-sexp' properly moves over sexps."
437+ (should (with-temp-buffer
438+ (insert " foo = bar . baz" )
439+ (goto-char 1 )
440+ (haskell-forward-sexp 4 )
441+ (eq (point ) 12 ))))
442+
443+ (ert-deftest haskell-forward-sexp-2 ()
444+ " Check if `haskell-forward-sexp' properly moves over sexps."
445+ (should (with-temp-buffer
446+ (insert " foo = bar . baz" )
447+ (goto-char 1 )
448+ (haskell-forward-sexp 1 )
449+ (eq (point ) 4 ))))
450+
451+ (ert-deftest haskell-forward-sexp-3 ()
452+ " Check if `haskell-forward-sexp' properly moves over sexps."
453+ (should (with-temp-buffer
454+ (insert " (a b) c = d . e" )
455+ (goto-char 1 )
456+ (haskell-forward-sexp 5 )
457+ (eq (point ) 14 ))))
458+
459+ (ert-deftest haskell-forward-sexp-4 ()
460+ " Check if `haskell-forward-sexp' properly moves over sexps."
461+ (should (with-temp-buffer
462+ (insert " (a b) c = d . e" )
463+ (goto-char 1 )
464+ (haskell-forward-sexp 1 )
465+ (eq (point ) 6 ))))
466+
413467(provide 'haskell-mode-tests )
0 commit comments