+
+;;-----------------------------------------------------
+;; Test buffer-local variables used as (ugh!) function parameters
+;;-----------------------------------------------------
+(make-local-variable 'test-emacs-buffer-local-variable)
+(byte-compile
+ (defun test-emacs-buffer-local-parameter (test-emacs-buffer-local-variable)
+ (setq test-emacs-buffer-local-variable nil)))
+(test-emacs-buffer-local-parameter nil)
+
+;;-----------------------------------------------------
+;; Test split-string
+;;-----------------------------------------------------
+;; Hrvoje didn't like these tests so I'm disabling them for now. -sb
+;(Assert (equal (split-string "foo" "") '("" "f" "o" "o" "")))
+;(Assert (equal (split-string "foo" "^") '("" "foo")))
+;(Assert (equal (split-string "foo" "$") '("foo" "")))
+(Assert (equal (split-string "foo,bar" ",") '("foo" "bar")))
+(Assert (equal (split-string ",foo,bar," ",") '("" "foo" "bar" "")))
+(Assert (equal (split-string ",foo,bar," "^,") '("" "foo,bar,")))
+(Assert (equal (split-string ",foo,bar," ",$") '(",foo,bar" "")))
+(Assert (equal (split-string ",foo,,bar," ",") '("" "foo" "" "bar" "")))
+(Assert (equal (split-string "foo,,,bar" ",") '("foo" "" "" "bar")))
+(Assert (equal (split-string "foo,,bar,," ",") '("foo" "" "bar" "" "")))
+(Assert (equal (split-string "foo,,bar" ",+") '("foo" "bar")))
+(Assert (equal (split-string ",foo,,bar," ",+") '("" "foo" "bar" "")))
+
+;;-----------------------------------------------------
+;; Test near-text buffer functions.
+;;-----------------------------------------------------
+(with-temp-buffer
+ (erase-buffer)
+ (Assert (eq (char-before) nil))
+ (Assert (eq (char-before (point)) nil))
+ (Assert (eq (char-before (point-marker)) nil))
+ (Assert (eq (char-before (point) (current-buffer)) nil))
+ (Assert (eq (char-before (point-marker) (current-buffer)) nil))
+ (Assert (eq (char-after) nil))
+ (Assert (eq (char-after (point)) nil))
+ (Assert (eq (char-after (point-marker)) nil))
+ (Assert (eq (char-after (point) (current-buffer)) nil))
+ (Assert (eq (char-after (point-marker) (current-buffer)) nil))
+ (Assert (eq (preceding-char) 0))
+ (Assert (eq (preceding-char (current-buffer)) 0))
+ (Assert (eq (following-char) 0))
+ (Assert (eq (following-char (current-buffer)) 0))
+ (insert "foobar")
+ (Assert (eq (char-before) ?r))
+ (Assert (eq (char-after) nil))
+ (Assert (eq (preceding-char) ?r))
+ (Assert (eq (following-char) 0))
+ (goto-char (point-min))
+ (Assert (eq (char-before) nil))
+ (Assert (eq (char-after) ?f))
+ (Assert (eq (preceding-char) 0))
+ (Assert (eq (following-char) ?f))
+ )