Re: Diffing string checker
On Fri, Feb 26, 2016 at 12:04 AM Eric Snow wrote: > On Wed, Feb 24, 2016 at 11:26 PM, Andrew Wilkins > wrote: > > Howdy, > > > > Occasionally I'll change a test, and some string equality test will fail > > with a wall of text. Sometimes we shouldn't be checking the whole string, > > but sometimes it's legitimate to do so, and it can be difficult/tedious > to > > spot the differences. > > > > I've just written a checker which diffs the two string args, and > colourises > > the output. You may find it useful. I'm using red/green background, but I > > also added bold for insertions, strike-through for deletions, in case > you're > > red/green colour blind. My terminal doesn't do strike-through, and your's > > probably doesn't either. Anyway, the important thing is you can see the > > difference between bits that are the same vs. insertions/deletions. > > > > Code is at github.com/axw/fancycheck. Just replace > > c.Assert("x", gc.Equals, "y") > > with > > c.Assert("x", fancycheck.StringEquals, "y") > > FYI, I added something like this to the juju repo a while back: > > https://github.com/juju/juju/blob/master/testing/base.go#L166 > > It's not a gc checker like yours but it has the same effect. > https://github.com/juju/juju/blob/master/testing/base.go#L173 :) Thanks, Eric. Maybe we should update that to use diffmatchpatch. Or we could just settle on an output filtering tool, rather than changing all of the tests. -eric > -- Juju-dev mailing list Juju-dev@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
Re: Diffing string checker
On Wed, Feb 24, 2016 at 11:26 PM, Andrew Wilkins wrote: > Howdy, > > Occasionally I'll change a test, and some string equality test will fail > with a wall of text. Sometimes we shouldn't be checking the whole string, > but sometimes it's legitimate to do so, and it can be difficult/tedious to > spot the differences. > > I've just written a checker which diffs the two string args, and colourises > the output. You may find it useful. I'm using red/green background, but I > also added bold for insertions, strike-through for deletions, in case you're > red/green colour blind. My terminal doesn't do strike-through, and your's > probably doesn't either. Anyway, the important thing is you can see the > difference between bits that are the same vs. insertions/deletions. > > Code is at github.com/axw/fancycheck. Just replace > c.Assert("x", gc.Equals, "y") > with > c.Assert("x", fancycheck.StringEquals, "y") FYI, I added something like this to the juju repo a while back: https://github.com/juju/juju/blob/master/testing/base.go#L166 It's not a gc checker like yours but it has the same effect. -eric -- Juju-dev mailing list Juju-dev@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
Re: Diffing string checker
I agree with Horacio, you're my hero, Andrew. I was actually just looking at sergi's diffmatchpatch implementation for exactly this purpose a couple days ago. Thanks for doing that! On Thu, Feb 25, 2016 at 6:09 AM Andrew Wilkins wrote: > On Thu, Feb 25, 2016 at 5:23 PM roger peppe wrote: > >> Nice. FWIW I have a related tool that tries to help find where a regexp >> mismatch has happened. It parses the output of gocheck, so it's >> probably not that useful to non-acme users but you might want >> to consider including the approach (http://paste.ubuntu.com/15195795/) >> for fancycheck.Matches and ErrorMatches, perhaps, to highlight where >> the mismatch starts. >> > > Thanks, that is a better idea. I'll look into doing that next time I'm > staring at a wall of text :) > > >> On 25 February 2016 at 06:26, Andrew Wilkins >> wrote: >> > Howdy, >> > >> > Occasionally I'll change a test, and some string equality test will fail >> > with a wall of text. Sometimes we shouldn't be checking the whole >> string, >> > but sometimes it's legitimate to do so, and it can be difficult/tedious >> to >> > spot the differences. >> > >> > I've just written a checker which diffs the two string args, and >> colourises >> > the output. You may find it useful. I'm using red/green background, but >> I >> > also added bold for insertions, strike-through for deletions, in case >> you're >> > red/green colour blind. My terminal doesn't do strike-through, and >> your's >> > probably doesn't either. Anyway, the important thing is you can see the >> > difference between bits that are the same vs. insertions/deletions. >> > >> > Code is at github.com/axw/fancycheck. Just replace >> > c.Assert("x", gc.Equals, "y") >> > with >> > c.Assert("x", fancycheck.StringEquals, "y") >> > >> > Cheers, >> > Andrew >> > >> > -- >> > Juju-dev mailing list >> > Juju-dev@lists.ubuntu.com >> > Modify settings or unsubscribe at: >> > https://lists.ubuntu.com/mailman/listinfo/juju-dev >> > >> > -- > Juju-dev mailing list > Juju-dev@lists.ubuntu.com > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/juju-dev > -- Juju-dev mailing list Juju-dev@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
Re: Diffing string checker
On Thu, Feb 25, 2016 at 5:23 PM roger peppe wrote: > Nice. FWIW I have a related tool that tries to help find where a regexp > mismatch has happened. It parses the output of gocheck, so it's > probably not that useful to non-acme users but you might want > to consider including the approach (http://paste.ubuntu.com/15195795/) > for fancycheck.Matches and ErrorMatches, perhaps, to highlight where > the mismatch starts. > Thanks, that is a better idea. I'll look into doing that next time I'm staring at a wall of text :) > On 25 February 2016 at 06:26, Andrew Wilkins > wrote: > > Howdy, > > > > Occasionally I'll change a test, and some string equality test will fail > > with a wall of text. Sometimes we shouldn't be checking the whole string, > > but sometimes it's legitimate to do so, and it can be difficult/tedious > to > > spot the differences. > > > > I've just written a checker which diffs the two string args, and > colourises > > the output. You may find it useful. I'm using red/green background, but I > > also added bold for insertions, strike-through for deletions, in case > you're > > red/green colour blind. My terminal doesn't do strike-through, and your's > > probably doesn't either. Anyway, the important thing is you can see the > > difference between bits that are the same vs. insertions/deletions. > > > > Code is at github.com/axw/fancycheck. Just replace > > c.Assert("x", gc.Equals, "y") > > with > > c.Assert("x", fancycheck.StringEquals, "y") > > > > Cheers, > > Andrew > > > > -- > > Juju-dev mailing list > > Juju-dev@lists.ubuntu.com > > Modify settings or unsubscribe at: > > https://lists.ubuntu.com/mailman/listinfo/juju-dev > > > -- Juju-dev mailing list Juju-dev@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
Re: Diffing string checker
Nice. FWIW I have a related tool that tries to help find where a regexp mismatch has happened. It parses the output of gocheck, so it's probably not that useful to non-acme users but you might want to consider including the approach (http://paste.ubuntu.com/15195795/) for fancycheck.Matches and ErrorMatches, perhaps, to highlight where the mismatch starts. On 25 February 2016 at 06:26, Andrew Wilkins wrote: > Howdy, > > Occasionally I'll change a test, and some string equality test will fail > with a wall of text. Sometimes we shouldn't be checking the whole string, > but sometimes it's legitimate to do so, and it can be difficult/tedious to > spot the differences. > > I've just written a checker which diffs the two string args, and colourises > the output. You may find it useful. I'm using red/green background, but I > also added bold for insertions, strike-through for deletions, in case you're > red/green colour blind. My terminal doesn't do strike-through, and your's > probably doesn't either. Anyway, the important thing is you can see the > difference between bits that are the same vs. insertions/deletions. > > Code is at github.com/axw/fancycheck. Just replace > c.Assert("x", gc.Equals, "y") > with > c.Assert("x", fancycheck.StringEquals, "y") > > Cheers, > Andrew > > -- > Juju-dev mailing list > Juju-dev@lists.ubuntu.com > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/juju-dev > -- Juju-dev mailing list Juju-dev@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
Re: Diffing string checker
You are my new personal hero On Thursday, 25 February 2016, Andrew Wilkins wrote: > Howdy, > > Occasionally I'll change a test, and some string equality test will fail > with a wall of text. Sometimes we shouldn't be checking the whole string, > but sometimes it's legitimate to do so, and it can be difficult/tedious to > spot the differences. > > I've just written a checker which diffs the two string args, and > colourises the output. You may find it useful. I'm using red/green > background, but I also added bold for insertions, strike-through for > deletions, in case you're red/green colour blind. My terminal doesn't do > strike-through, and your's probably doesn't either. Anyway, the important > thing is you can see the difference between bits that are the same vs. > insertions/deletions. > > Code is at github.com/axw/fancycheck. Just replace > c.Assert("x", gc.Equals, "y") > with > c.Assert("x", fancycheck.StringEquals, "y") > > Cheers, > Andrew > -- Juju-dev mailing list Juju-dev@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
Diffing string checker
Howdy, Occasionally I'll change a test, and some string equality test will fail with a wall of text. Sometimes we shouldn't be checking the whole string, but sometimes it's legitimate to do so, and it can be difficult/tedious to spot the differences. I've just written a checker which diffs the two string args, and colourises the output. You may find it useful. I'm using red/green background, but I also added bold for insertions, strike-through for deletions, in case you're red/green colour blind. My terminal doesn't do strike-through, and your's probably doesn't either. Anyway, the important thing is you can see the difference between bits that are the same vs. insertions/deletions. Code is at github.com/axw/fancycheck. Just replace c.Assert("x", gc.Equals, "y") with c.Assert("x", fancycheck.StringEquals, "y") Cheers, Andrew -- Juju-dev mailing list Juju-dev@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev