Adds the ability to show a diff when `guard_msgs` fails, using the histogram diff algorithm pioneered in jgit. This algorithm tends to produce more user-friendly diffs, but it can be quadratic in the worst case. Empirically, the quadratic case of this implementation doesn't seem to be slow enough to matter for messages smaller than hundreds of megabytes, but if it's ever a problem, we can mitigate it the same way jgit does by falling back to Myers diff. See lean/run/guard_msgs.lean in the tests directory for some examples of its output.
37 lines
910 B
Text
37 lines
910 B
Text
/-
|
|
Copyright (c) 2016 Microsoft Corporation. All rights reserved.
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
Authors: Leonardo de Moura
|
|
-/
|
|
prelude
|
|
import Init.Data.Basic
|
|
import Init.Data.Nat
|
|
import Init.Data.Bool
|
|
import Init.Data.BitVec
|
|
import Init.Data.Cast
|
|
import Init.Data.Char
|
|
import Init.Data.String
|
|
import Init.Data.List
|
|
import Init.Data.Int
|
|
import Init.Data.Array
|
|
import Init.Data.Array.Subarray.Split
|
|
import Init.Data.ByteArray
|
|
import Init.Data.FloatArray
|
|
import Init.Data.Fin
|
|
import Init.Data.UInt
|
|
import Init.Data.Float
|
|
import Init.Data.Option
|
|
import Init.Data.Ord
|
|
import Init.Data.Random
|
|
import Init.Data.ToString
|
|
import Init.Data.Range
|
|
import Init.Data.Hashable
|
|
import Init.Data.OfScientific
|
|
import Init.Data.Format
|
|
import Init.Data.Stream
|
|
import Init.Data.Prod
|
|
import Init.Data.AC
|
|
import Init.Data.Queue
|
|
import Init.Data.Channel
|
|
import Init.Data.Cast
|
|
import Init.Data.Sum
|