]> code.delx.au - gnu-emacs-elpa/commitdiff
Convert from test-unit to test-simple
authorrocky <rocky@gnu.org>
Fri, 29 Jun 2012 23:17:40 +0000 (06:17 +0700)
committerrocky <rocky@gnu.org>
Fri, 29 Jun 2012 23:17:40 +0000 (06:17 +0700)
Makefile.am
common.mk [new file with mode: 0644]
configure.ac
install-from-git.sh
make-check-filter.rb [new file with mode: 0644]
test/Makefile
test/Makefile.am [new file with mode: 0644]
test/test-basic.el

index 23f38a1f976e8b3b5febcb1e6d0d00a900714e50..bd9ca8e56bb9d4273d49f13c3e1de7eaee576fb0 100644 (file)
@@ -1,3 +1,5 @@
+SUBDIRS = test
+
 lisp_files := $(wildcard *.el)
 test_files := $(wildcard test/test-*.el)
 
@@ -7,14 +9,7 @@ CHECK_FILES = $(notdir $(test_files:.el=.run))
 
 lisp_LISP = $(lisp_files)
 
-check: $(CHECK_FILES)
-
-
-# FIGURE out how to DRY the run rules.
-test-basic.run:
-       (cd $(srcdir)/test && $(EMACS)  --batch --no-site-file --no-splash --load $(@:.run=.el) )
-
-.PHONY: $(CHECK_FILES)
+check: test
 
 if MAINTAINER_MODE
 
@@ -26,7 +21,6 @@ ACLOCAL_AMFLAGS=-I .
 
 endif
 
-test: check
 
 
 
diff --git a/common.mk b/common.mk
new file mode 100644 (file)
index 0000000..26b6325
--- /dev/null
+++ b/common.mk
@@ -0,0 +1,5 @@
+short:
+       $(MAKE) 2>&1 >/dev/null | ruby $(top_srcdir)/make-check-filter.rb
+
+%.short:
+       $(MAKE) $(@:.short=) 2>&1 >/dev/null
index 0a98606c912322c506b8ea5b7d54b63e065fdf51..d2713c9c4569cebb0c94e05a1f8cb525ff422869 100644 (file)
@@ -9,5 +9,5 @@ AM_MAINTAINER_MODE
 AM_PATH_LISPDIR
 AM_CONDITIONAL(INSTALL_EMACS_LISP, test "x$lispdir" != "x")
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile test/Makefile])
 AC_OUTPUT
index 7df324e5364930924cb98fdefc4e1df4f4a0ee4a..5bed782a93d5a41e22ab7b1610a8436196b34f19 100755 (executable)
@@ -20,7 +20,7 @@ for program in git make $need_sudo ; do
     fi
 done
 
-packages=emacs-{test-unit,test-simple,load-relative,loc-changes,dbgr}
+packages=emacs-{test-simple,load-relative,loc-changes,dbgr}
 for pkg in $packages ; do 
     echo '******************************************'
     echo Trying to install ${pkg}...
diff --git a/make-check-filter.rb b/make-check-filter.rb
new file mode 100644 (file)
index 0000000..d7d5cbf
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/env ruby
+# Use this to cut out the crud from make check.
+# Use like this:
+#   make check 2>&1  | ruby ../make-check-filter.rb
+# See Makefile.am
+pats = ["^(?:Loading",
+        '(re)?make\[',
+        "Making check in",
+        '\(cd \.\.',
+        "make -C",
+        "Test-Unit",
+        "Fontifying",
+        '\s*$',
+        '##[<>]+$'
+       ].join('|') + ')'
+# puts pats
+skip_re = /#{pats}/
+
+while gets()
+  next if $_ =~ skip_re
+  puts $_
+end
index bc80236c1fabc2dafbad79628b6c44ecaa5bd847..18c87df4e6dac3590d0f6d07e99f62d28cf8bd15 100644 (file)
@@ -1,7 +1,338 @@
-# Whatever it is you want to do, it should be forwarded to the 
-# to top-level irectories
-PHONY=check all
-all: check
+# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# test/Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+pkgdatadir = $(datadir)/emacs-loc-changes
+pkgincludedir = $(includedir)/emacs-loc-changes
+pkglibdir = $(libdir)/emacs-loc-changes
+pkglibexecdir = $(libexecdir)/emacs-loc-changes
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(top_srcdir)/common.mk
+subdir = test
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /src/external-vcs/emacs-loc-changes/missing --run aclocal-1.11
+AMTAR = $${TAR-tar}
+AUTOCONF = ${SHELL} /src/external-vcs/emacs-loc-changes/missing --run autoconf
+AUTOHEADER = ${SHELL} /src/external-vcs/emacs-loc-changes/missing --run autoheader
+AUTOMAKE = ${SHELL} /src/external-vcs/emacs-loc-changes/missing --run automake-1.11
+AWK = gawk
+CYGPATH_W = echo
+DEFS = -DPACKAGE_NAME=\"emacs-loc-changes\" -DPACKAGE_TARNAME=\"emacs-loc-changes\" -DPACKAGE_VERSION=\"0.01vc\" -DPACKAGE_STRING=\"emacs-loc-changes\ 0.01vc\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"emacs-loc-changes\" -DVERSION=\"0.01vc\"
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EMACS = emacs
+EMACSLOADPATH = 
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LIBOBJS = 
+LIBS = 
+LTLIBOBJS = 
+MAINT = 
+MAKEINFO = ${SHELL} /src/external-vcs/emacs-loc-changes/missing --run makeinfo
+MKDIR_P = /bin/mkdir -p
+PACKAGE = emacs-loc-changes
+PACKAGE_BUGREPORT = 
+PACKAGE_NAME = emacs-loc-changes
+PACKAGE_STRING = emacs-loc-changes 0.01vc
+PACKAGE_TARNAME = emacs-loc-changes
+PACKAGE_URL = 
+PACKAGE_VERSION = 0.01vc
+PATH_SEPARATOR = :
+SET_MAKE = 
+SHELL = /bin/bash
+STRIP = 
+VERSION = 0.01vc
+abs_builddir = /src/external-vcs/emacs-loc-changes/test
+abs_srcdir = /src/external-vcs/emacs-loc-changes/test
+abs_top_builddir = /src/external-vcs/emacs-loc-changes
+abs_top_srcdir = /src/external-vcs/emacs-loc-changes
+am__leading_dot = .
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build_alias = 
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host_alias = 
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /src/external-vcs/emacs-loc-changes/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+lispdir = ${datarootdir}/emacs/site-lisp
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = /bin/mkdir -p
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../
+top_builddir = ..
+top_srcdir = ..
+PHONY = check test all
+EXTRA_DIST = sample.txt
+test_files := $(wildcard test-*.el)
+CHECK_FILES = $(notdir $(test_files:.el=.run))
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+$(top_srcdir)/common.mk:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
 
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+       distclean-generic distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
+
+short:
+       $(MAKE) 2>&1 >/dev/null | ruby $(top_srcdir)/make-check-filter.rb
+
+%.short:
+       $(MAKE) $(@:.short=) 2>&1 >/dev/null
+
+all: 
+
+#: same thing as "check"
+test: check
+
+#: Run all tests
+check: $(CHECK_FILES)
+
+#: Run all tests with minimum verbosity
+check-short:
+       $(MAKE) check 2>&1  | ruby ../make-check-filter.rb
+
+test-%.run:
+       (cd $(top_srcdir)/test && $(EMACS) --batch --no-site-file --no-splash --load $(@:.run=.el))
+
+# Whatever it is you want to do, it should be forwarded to the 
+# to top-level directories
 %: 
        $(MAKE) -C .. $@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644 (file)
index 0000000..d5cd2c8
--- /dev/null
@@ -0,0 +1,29 @@
+include $(top_srcdir)/common.mk
+
+PHONY=check test all
+EXTRA_DIST=sample.txt
+
+all: 
+
+#: same thing as "check"
+test: check
+
+test_files := $(wildcard test-*.el)
+
+CHECK_FILES = $(notdir $(test_files:.el=.run))
+
+#: Run all tests
+check: $(CHECK_FILES)
+
+#: Run all tests with minimum verbosity
+check-short:
+       $(MAKE) check 2>&1  | ruby ../make-check-filter.rb
+
+test-%.run:
+       (cd $(top_srcdir)/test && $(EMACS) --batch --no-site-file --no-splash --load $(@:.run=.el))
+
+# Whatever it is you want to do, it should be forwarded to the 
+# to top-level directories
+%: 
+       $(MAKE) -C .. $@
+
index 77d5408c02779dc28586f53dbef3a30d6eb9a0fc..b0e6a43df07d321a3bddae4d36bdfa8016b684ef 100644 (file)
@@ -1,86 +1,84 @@
 (require 'cl)
-(require 'test-unit)
+(require 'test-simple)
 (load-file "../loc-changes.el")
 
-(test-unit-clear-contexts)
+(test-simple-start)
 
 (setq sample-buffer (find-file-noselect "./sample.txt"))
-(context "basic-tests"
-        (tag basic-tests)
-          (specify "loc-changes-goto-line error conditions"
-                   (assert-raises error (loc-changes-goto-line "foo"))
-                   (message "buffer %s" (current-buffer))
-                   (assert-raises error (loc-changes-goto-line "0"))
-                   (assert-raises error (loc-changes-goto-line 0))
-                   (assert-raises error (loc-changes-goto-line 10000)))
-          (specify "loc-changes-goto-line"
-                   (save-excursion
-                     (set-buffer sample-buffer)
-                     (loc-changes-goto-line 5)
-                     (assert-equal 5 (line-number-at-pos (point)))))
-          (specify "loc-changes-goto-line-with-column"
-                   (save-excursion
-                     (set-buffer sample-buffer)
-                     (loc-changes-goto-line 1 3)
-                     (assert-equal 1 (line-number-at-pos (point)))
-                     (assert-equal 2 (current-column))
-                     )
-                   )
-          (specify "loc-changes-goto-line-invalid-column"
-                   (save-excursion
-                     (set-buffer sample-buffer)
-                     (loc-changes-goto-line 1 300)
-                     (assert-equal 1 (line-number-at-pos (point)))
-                     (assert-equal 0 (current-column))
-                     (assert-t (or
-                                (not (current-message))
-                                (string-match "^Column ignored." (current-message))))
-                     (loc-changes-goto-line 2 -5)
-                     (assert-equal 2 (line-number-at-pos (point)))
-                     (assert-equal 0 (current-column))
-                     (assert-t (or
-                                (not (current-message))
-                                (string-match "^Column ignored." (current-message))))
-                     )
-                   )
-          (specify "loc-changes-clear-buffer null"
-                   (loc-changes-clear-buffer)
-                   (assert-equal '() loc-changes-alist))
 
-          (specify "loc-changes-add-and-goto - update"
-                   (save-excursion
-                     (set-buffer sample-buffer)
-                     (loc-changes-add-and-goto 10)
-                     (assert-equal 10 (line-number-at-pos)
-                                   "point should be at line 10")
-                     (assert-t (assq 10 loc-changes-alist)
-                               "Should find 10 in loc-changes-alist")
-                     (assert-t (markerp (cdr (assq 10 loc-changes-alist)))
-                               "10 in loc-changes-alist should be a marker"))
-                   )
+(note "loc-changes-goto-line error conditions")
+(assert-raises error (loc-changes-goto-line "foo"))
+(message "buffer %s" (current-buffer))
+(assert-raises error (loc-changes-goto-line "0"))
+(assert-raises error (loc-changes-goto-line 0))
+(assert-raises error (loc-changes-goto-line 10000))
 
-          (specify "loc-changes-goto - update"
-                   (save-excursion
-                     (set-buffer sample-buffer)
-                     (loc-changes-goto 11)
-                     (assert-equal 11 (line-number-at-pos)
-                                   "point should be at line 11")
-                     (assert-t (assq 11 loc-changes-alist)
-                               "Should find 11 in loc-changes-alist")
-                     (assert-t (markerp (cdr (assq 11 loc-changes-alist)))
-                               "11 in loc-changes-alist should be a marker"))
-                   )
+(save-excursion
+  (set-buffer sample-buffer)
+  (loc-changes-goto-line 5)
+  (assert-equal 5 (line-number-at-pos (point)) "loc-changes-goto-line"))
 
-          (specify "loc-changes-goto - no update"
-                   (save-excursion
-                     (set-buffer sample-buffer)
-                     (loc-changes-goto 12 nil 't)
-                     (assert-equal 12 (line-number-at-pos)
-                                   "point should be at line 12")
-                     (assert-nil (assq 12 loc-changes-alist)
-                                 "Should not find 12 in loc-changes-alist")
-                     )
-                   )
-          )
+(note "loc-changes-goto-line-with-column")
+(with-current-buffer sample-buffer
+  (switch-to-buffer sample-buffer)
+  (loc-changes-goto-line 1 3)
+  (assert-equal 1 (line-number-at-pos (point)))
+  (assert-equal 2 (current-column))
+  (switch-to-buffer nil)
+  )
 
-(test-unit "basic-tests")
+(note "loc-changes-goto-line-invalid-column")
+(with-current-buffer sample-buffer
+  (switch-to-buffer sample-buffer)
+  (loc-changes-goto-line 1 300)
+  (assert-equal 1 (line-number-at-pos (point)))
+  (assert-equal 0 (current-column))
+  (assert-t (or
+            (not (current-message))
+            (string-match "^Column ignored." (current-message))))
+  (loc-changes-goto-line 2 -5)
+  (assert-equal 2 (line-number-at-pos (point)))
+  (assert-equal 0 (current-column))
+  (assert-t (or
+            (not (current-message))
+            (string-match "^Column ignored." (current-message))))
+  (switch-to-buffer nil)
+  )
+
+(loc-changes-clear-buffer)
+(assert-equal '() loc-changes-alist "loc-changes-clear-buffer null")
+
+(note "loc-changes-add-and-goto - update")
+(save-excursion
+  (set-buffer sample-buffer)
+  (loc-changes-add-and-goto 10)
+  (assert-equal 10 (line-number-at-pos)
+               "point should be at line 10")
+  (assert-t (assq 10 loc-changes-alist)
+           "Should find 10 in loc-changes-alist")
+  (assert-t (markerp (cdr (assq 10 loc-changes-alist)))
+           "10 in loc-changes-alist should be a marker"))
+
+
+(note "loc-changes-goto - update")
+(save-excursion
+  (set-buffer sample-buffer)
+  (loc-changes-goto 11)
+  (assert-equal 11 (line-number-at-pos)
+               "point should be at line 11")
+          (assert-t (assq 11 loc-changes-alist)
+                    "Should find 11 in loc-changes-alist")
+          (assert-t (markerp (cdr (assq 11 loc-changes-alist)))
+                    "11 in loc-changes-alist should be a marker"))
+
+(note "loc-changes-goto - no update")
+(save-excursion
+  (set-buffer sample-buffer)
+  (loc-changes-goto 12 nil 't)
+  (assert-equal 12 (line-number-at-pos)
+               "point should be at line 12")
+  (assert-nil (assq 12 loc-changes-alist)
+             "Should not find 12 in loc-changes-alist")
+  )
+
+(end-tests)