Skip to content

hyotang666/vivid-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VIVID-DIFF 2.0.0

What is this?

Colored object diff viewer.

Intended to be used in the test frameworks.

Alternatives and differences.

name target output patch
cl-difflib sequence unix-style *
clos-diff clos-object list *
monkeylib-prose-diff text-file html
diff text-file unix-style
diff-match-patch sequence list *
vivid-diff any object colored

Usage

(let ((expected '(:a :b :c))
      (actual '(:a "b" :c)))
  (diff-print (mismatch-sexp actual expected)))

image of the conses diff.

(let ((expected "Common Lisp is awesome!!")
      (actual   "Common lisp is awesome!!"))
  (diff-print (mismatch-sexp actual expected)))

image of the string diff.

(let ((expected (alexandria:plist-hash-table '(:a "a" :b "b" :c "c")))
      (actual (alexandria:plist-hash-table '(:b :b :c "c" :d "d"))))
  (diff-print (mismatch-sexp actual expected)))

image of the hash-table diff.

As the name shows, MISMATCH-SEXP is for S-Expression, i.e. macroexpanded form. Please note about uninterned symbols are treated as the same as expected. (In corner cases, this behavior may be the pitfall though.)

(let ((expected (macroexpand-1 '(with-open-file (s "path") (read s))))
      (actual (macroexpand-1 '(with-open-file (out "path") (read out)))))
  (diff-print (mismatch-sexp actual expected)))

image of the macroexpanded diff.

From developer

Product's goal

License

MIT

Developed with

SBCL

Tested with

  • SBCL/2.2.4
  • CCL/1.12.1
  • ECL/21.2.1
  • CLISP/2.49
  • Allegro/10.1
  • CMUCL/21D ; See below.
  • ABCL/1.9.0

Known issue

CMUCL

CMUCL pass the test of vivid-diff but vivid-colors that vivid-diff depends on does not support CMUCL.

Installation

About

Colored object diff viewer for common lisp.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published