[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gnuplot 319a176 072/184: clean up tests a bit
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gnuplot 319a176 072/184: clean up tests a bit |
Date: |
Sun, 29 Aug 2021 11:03:18 -0400 (EDT) |
branch: elpa/gnuplot
commit 319a176942f53959aa4f03b9e9e0ebe00698870a
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>
clean up tests a bit
---
gnuplot-test-context.el | 87 +++++++++++++++++++++++++++----------------------
1 file changed, 48 insertions(+), 39 deletions(-)
diff --git a/gnuplot-test-context.el b/gnuplot-test-context.el
index ba7a165..bd66d7a 100644
--- a/gnuplot-test-context.el
+++ b/gnuplot-test-context.el
@@ -16,7 +16,7 @@
(insert string)
(goto-char (point-max))
(gnuplot-tokenize)))
-
+
(defmacro with-gnuplot-tokens-from-string (binding &rest body)
(declare (indent 1))
`(with-temp-buffer
@@ -24,7 +24,7 @@
(insert ,(cadr binding))
(let ((,(car binding) (gnuplot-tokenize)))
,@body)))
-
+
(defun gnuplot-simplify-tokens (tokens)
(mapcar
(lambda (token)
@@ -36,17 +36,17 @@
(gnuplot-token-id token))
(end-of-command 'end-of-command)
-
+
(otherwise
(intern (gnuplot-token-id token)))))
- tokens))
+ tokens))
;; compile a single pattern to usable form
(eval-and-compile
(defun gnuplot-compile-pattern-1 (pattern)
(gnuplot-compile-grammar `((rule ,pattern)) 'rule)))
-
-;; match a string
+
+;; match a string
(defun gnuplot-match-string (string rule)
(if (vectorp rule)
(gnuplot-match-pattern
@@ -236,18 +236,18 @@
;; axis ranges
(deftest gnuplot-axis-range ()
(should-match axis-range
- ("[-pi:pi]")
- ("[-1:1]")
- ("[t = -10 :30]")
- ("[ ]")
- ("[-2:sin(5)*-8]")
- ("[:200]")
- ("[foo=:200]")
- ("[-pi:]")
- ("[bar=-pi:]")
- ("[baz=1:100*2:3/2]")
- ("[-pi:pi:0.2]")
- ("[\"1/6/93 12:00\":\"5/6/93 12:00\"]")))
+ ("[-pi:pi]")
+ ("[-1:1]")
+ ("[t = -10 :30]")
+ ("[ ]")
+ ("[-2:sin(5)*-8]")
+ ("[:200]")
+ ("[foo=:200]")
+ ("[-pi:]")
+ ("[bar=-pi:]")
+ ("[baz=1:100*2:3/2]")
+ ("[-pi:pi:0.2]")
+ ("[\"1/6/93 12:00\":\"5/6/93 12:00\"]")))
;; iteration
(deftest gnuplot-iteration-spec ()
@@ -300,16 +300,16 @@
(deftest gnuplot-plot-command ()
(should-match plot-command
("plot sin(x) with impulses")
- ("plot x w points, x**2")
- ("plot [ ] [-2:5] tan(x), 'data.1' with l")
- ("plot 'leastsq.dat' w i")
- ("plot 'exper.dat' w lines, 'exper.dat' notitle w errorbars")
- ("plot sin(x) with linesp lt 1 pt 3, cos(x) with linesp lt 1 pt 4")
- ("plot 'data' with points pointtype 3 pointsize 2")
- ("plot 'data' using 1:2:4 with points pt 5 pointsize variable")
- ("plot 'd1' t \"good\" w l lt 2 lw 3, 'd2' t \"bad\" w l lt 2 lw 1")
- ("plot x*x with filledcurve closed, 40 with filledcurve y1=10")
- ("plot x*x, (x>=-5 && x<=5 ? 40 : 1/0) with filledcurve y1=10 lt 8")))
+ ("plot x w points, x**2")
+ ("plot [ ] [-2:5] tan(x), 'data.1' with l")
+ ("plot 'leastsq.dat' w i")
+ ("plot 'exper.dat' w lines, 'exper.dat' notitle w errorbars")
+ ("plot sin(x) with linesp lt 1 pt 3, cos(x) with linesp lt 1 pt 4")
+ ("plot 'data' with points pointtype 3 pointsize 2")
+ ("plot 'data' using 1:2:4 with points pt 5 pointsize variable")
+ ("plot 'd1' t \"good\" w l lt 2 lw 3, 'd2' t \"bad\" w l lt 2 lw 1")
+ ("plot x*x with filledcurve closed, 40 with filledcurve y1=10")
+ ("plot x*x, (x>=-5 && x<=5 ? 40 : 1/0) with filledcurve y1=10 lt 8")))
;;; set cntrparam
(deftest gnuplot-cntrparam ()
@@ -322,16 +322,25 @@
("cntrparam levels incremental 0,1,4")
("cntrparam levels 10")
("cntrparam levels incremental 100,50")))
-
+
;;
-;; test by parsing all the demos
+;; test by parsing all the demos from the Gnuplot source tree
;;
+;; currently (Oct 2012) successfully parses about 84% of all
+;; non-comment lines in the Gnuplot demos, tho I think there are some
+;; false negatives in there too.
+;;
+
+;; Set this to wherever the gnuplot demos are
+(defvar gnuplot-demo-dir "~/dev/gnuplot/demo/")
(defvar gnuplot-test-result-buffer "*gnuplot parse test results*")
(defvar gnuplot-test-count 0)
(defvar gnuplot-test-success-count 0)
+(if (not (fboundp 'line-number-at-pos))
+ (defalias 'line-number-at-pos 'line-number))
(defun gnuplot-test-parse-all-demos ()
(interactive)
@@ -343,16 +352,15 @@
(get-buffer-create bufname)))
(gnuplot-test-count 0)
(gnuplot-test-success-count 0)
- (demo-dir "~/dev/gnuplot/demo/")
- (demo-files (directory-files demo-dir t "^[^.].*\\.dem$"))
+ (demo-files (directory-files gnuplot-demo-dir t "^[^.].*\\.dem$"))
(n-files (length demo-files))
(n 0))
-
+
(switch-to-buffer-other-window gnuplot-test-result-buffer)
(catch 'done
(dolist (fname demo-files)
-
+
(with-temp-buffer
(insert-file-contents fname)
(gnuplot-mode)
@@ -368,7 +376,7 @@
(with-current-buffer gnuplot-test-result-buffer
(goto-char (point-max))
(recenter)))))
-
+
(with-current-buffer gnuplot-test-result-buffer
(insert (format "\n\nPassed %s out of %s tests (%.2f%%)\n"
gnuplot-test-success-count
@@ -410,10 +418,11 @@
(gnuplot-simplify-tokens (car result)))))))))))
(gnuplot-beginning-of-defun -1)))))
-(add-to-list 'compilation-error-regexp-alist-alist
- '(gnuplot-test-errors
- "^FAILED at \\([^:]*\\):\\([0-9]*\\)" 1 2))
+(when (boundp 'compilation-error-regexp-alist-alist)
+ (add-to-list 'compilation-error-regexp-alist-alist
+ '(gnuplot-test-errors
+ "^FAILED at \\([^:]*\\):\\([0-9]*\\)" 1 2))
-(add-to-list 'compilation-error-regexp-alist 'gnuplot-test-errors)
+ (add-to-list 'compilation-error-regexp-alist 'gnuplot-test-errors))
(provide 'gnuplot-test-context)
- [nongnu] elpa/gnuplot a7cfd1d 055/184: Abbreviate "print" command, (continued)
- [nongnu] elpa/gnuplot a7cfd1d 055/184: Abbreviate "print" command, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot ae5e628 074/184: Make context completion work on xemacs (21.4), ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 6e0ed5f 050/184: Added x2label, y2label to grammar, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 89e5445 053/184: Add customization options to turn context completion on and off., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot ffe6c66 059/184: First shot at implementing inline plot images in process buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 5030976 051/184: Alter header to conform to package.el specifications, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot e02534c 066/184: Add menu items for context-sensitive and inline-image modes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot a70749e 054/184: Fix "replot" command in grammar., ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 0ff395e 071/184: Compatibility hacks for pre-23 emacs versions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot c3e13f0 076/184: change version number to 0.7beta to avoid any confusion, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 319a176 072/184: clean up tests a bit,
ELPA Syncer <=
- [nongnu] elpa/gnuplot e9447f0 048/184: More consistent keys between gnuplot.el and gnuplot-context.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot ea83e14 081/184: cleanup parsing tests some more, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot b618811 069/184: Silence some compiler warnings about obsolete font-lock faces, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot c520e94 075/184: Remove a redundant check for gnuplot-keywords-pending, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 6792a81 083/184: Simple indentation fix for new block-structured do and if, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 7e33d0d 087/184: three fixes: indentation, require cl macros, fix defc, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot 9dd0e15 096/184: Avoid having text syntax-property changes mark buffer as modified, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot c52bb6c 089/184: grammar fixes for new-style if statement and blocks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot e457287 099/184: Add aclocal.m4 into repository, ELPA Syncer, 2021/08/29
- [nongnu] elpa/gnuplot f5c4437 100/184: Reduce autotools dependency to version 2.61, ELPA Syncer, 2021/08/29