vivid-diff

2022-07-08

Colored object diff viewer.

Upstream URL

github.com/hyotang666/vivid-diff

Author

SATO Shinichi

License

MIT
README

VIVID-DIFF 2.0.0

What is this?

Colored object diff viewer.

Intended to be used in the test frameworks.

Alternatives and differences.

nametargetoutputpatch
cl-difflibsequenceunix-style*
clos-diffclos-objectlist*
monkeylib-prose-difftext-filehtml
difftext-fileunix-style
diff-match-patchsequencelist*
vivid-diffany objectcolored

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

Dependencies (6)

  • cl-colors2
  • closer-mop
  • cl-ppcre
  • jingoh
  • matrix-case
  • vivid-colors

Dependents (1)

  • GitHub
  • Quicklisp