Skip to content

Clever output#996

Merged
nohwnd merged 22 commits intopester:masterfrom
nohwnd:clever-output
Feb 20, 2018
Merged

Clever output#996
nohwnd merged 22 commits intopester:masterfrom
nohwnd:clever-output

Conversation

@nohwnd
Copy link
Copy Markdown
Member

@nohwnd nohwnd commented Feb 20, 2018

Adds improved output, that expands $true, $false, $null, , collections dates and so on, to make the results of assertions, and test case expansions much easier to read.

Describing new assertion output
  [-] strings now have single quotes like 'this' 63ms
    Expected strings to be the same, but they were different.
    String lengths are both 4.
    Strings differ at index 0.
    Expected: ' abc'
    But was:  'abc '
    -----------^
    5:         'abc ' | Should -Be " abc"
  [-] empty string and null became <empty> and $null 36ms
    Expected <empty>, but got $null.
    9:         $null | Should -Be ''
  [-] numbers have nothing around them 30ms
    Expected 0, but got 1.
    13:         1 | Should -Be 0
  [-] decimals and doubles use point 0.1 45ms
    Expected 0, but got 0.1.
    17:         0.1 | Should -Be 0
  [-] booleans are written as $true and $false 71ms
    Expected $false, but got $true.
    21:         $true | Should -Be $false
  [-] dates are expanded to include ticks 83ms
    Expected 0001-01-01T00:00:00.0000000, but got 2018-02-20T18:39:15.7773648+01:00.
    25:         (Get-Date) | Should -Be ([datetime]::MinValue)
  [-] collections are wrapped in @() 49ms
    Expected an empty collection, but got collection with size 3 @(1, 2, 3).

Fix #944
Fix #631

@nohwnd nohwnd merged commit b8fa450 into pester:master Feb 20, 2018
@nohwnd nohwnd deleted the clever-output branch January 11, 2019 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant