haf / expecto

A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!
Apache License 2.0
663 stars 96 forks source link

Colors are a bit off #305

Closed forki closed 5 years ago

forki commented 5 years ago

type R = { Name : string; Age: int}

type R = { Name : string; Age: int}

let MyTTests =
  testList "records" 
    [

      testCase "show how records differ" (fun _ ->
        let r1 = { Name = "Steffen"; Age = 35 }
        let r2 = { Name = "Steffen"; Age = 36 }
        Expect.equal r1 r2 "only age is different"
      )
    ]

results in:

image

I'd assume only the 6 is green and only 5 is red!?

AnthonyLloyd commented 5 years ago

Will check. May need to off it and then set set it to the subtext colour to cover all terminals.

forki commented 5 years ago

thanks mate

AnthonyLloyd commented 5 years ago

NP

haf commented 5 years ago

This is not fixed yet; with latest Expecto

image
haf commented 5 years ago

Also, the colours as printed on dark backgrounds are bad for readability; we should use pastel colours, not primary ones.

AnthonyLloyd commented 5 years ago

It looks ok to me. Which part is wrong?

--colours 256 will give those colours.

haf commented 5 years ago

@AnthonyLloyd The red part with blue mixed in?

image
haf commented 5 years ago

--colours 256

This should be the default. If your terminal doesn't support it, you can opt out.

AnthonyLloyd commented 5 years ago

That's where the text at that position matches. Its going to happen even in random text. Would need a smarter diff algo. Maybe if just one char is diff in largw patch.

haf commented 5 years ago

Oh I see. I've never seen this diff algo beforee. Closing.