{"id":22208317,"url":"https://github.com/steenhansen/clojure-text-diff","last_synced_at":"2025-07-08T01:10:45.624Z","repository":{"id":149759777,"uuid":"219661262","full_name":"steenhansen/clojure-text-diff","owner":"steenhansen","description":"Colored text diffs for Clojure tests","archived":false,"fork":false,"pushed_at":"2019-12-28T05:44:20.000Z","size":232,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T04:36:13.814Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steenhansen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-05T05:00:25.000Z","updated_at":"2019-12-28T05:44:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d136ac0-1b47-49cc-8632-fcfd34bb9c93","html_url":"https://github.com/steenhansen/clojure-text-diff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/steenhansen/clojure-text-diff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steenhansen%2Fclojure-text-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steenhansen%2Fclojure-text-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steenhansen%2Fclojure-text-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steenhansen%2Fclojure-text-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steenhansen","download_url":"https://codeload.github.com/steenhansen/clojure-text-diff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steenhansen%2Fclojure-text-diff/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264171953,"owners_count":23567788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T19:17:35.468Z","updated_at":"2025-07-08T01:10:45.598Z","avatar_url":"https://github.com/steenhansen.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿﻿\r### Rational ﻿﻿﻿\r\rThe Clojure function 'text-diff/are-vars-eq' helps to quickly show small differences during testing with large bodies of html, convoluted maps/sets/lists/vectors, and unordered maps/sets. When unequal actual and expected values are tested, a short description of the similarities and differences are printed in the REPL. First, leading identical sections are displayed, followed by differences, and then finally identical ending sections.\r\r### How to use\r\r```\r;; clojure test file\r(ns my-test-ns\r    (:require [clojure.test :refer [is]])\r    (:require [text-diff :refer [are-vars-eq]]))\r\r(deftest test-html-values []\r  (let [actual-value   \"\u003csame\u003eDIFFERENT\u003c/same\u003e\"\r        expected-value \"\u003csame\u003edifferent\u003c/same\u003e\"\r        [diff-actual diff-expected] (are-vars-eq actual-value expected-value)]\r    (is (= diff-actual diff-expected)))\r)\r```\r\r\r```\r;; repl output\r|START|\"\u003csame\u003e\"\r|DIFF1|\"e\u003eDIFFERENT\u003c/\"\r|DIFF2|\"e\u003edifferent\u003c/\"\r|  END|\"\u003c/same\u003e\"\r\rexpected (= diff-actual diff-expected)\ractual (not (= \"DIFFERENT\" \"different\"))\rfalse\r```\r\r###Examples\r\r\r\r\r![Hard to see \\n versus \\r](images/a_r_vs_n.png)\r\r---\r\r![Hard to see 1 versus L](images/b_1_vs_l.png)\r\r---\r\r![Hard to see c versus X](images/c_out_order.png)\r\r---\r\r![Hard to see X versus Y](images/d_lots_x_y.png)\r\r---\r\r![Hard to see 1/3 versus 1/4](images/e_map_3_4.png)\r\r\r---\r\r![Hard to see ending \\n](images/f_end_n.png)\r\r\r---\r\r![Hard to see 8 versus 7](images/g_numbers_7_8.png)\r\r---\rOdd string behavior that is to be expected from string differences inside maps/sets/lists/vectors. Quote delimiters cause extra blank spaces because variable types are not taken into account.\r\r![Hard to see 8 versus 7](images/h_str_in_list.png)\r\r","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteenhansen%2Fclojure-text-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteenhansen%2Fclojure-text-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteenhansen%2Fclojure-text-diff/lists"}