Open ili101 opened 5 years ago
Added commit https://github.com/nohwnd/Assert/pull/45/commits/6166abfdae360098c4c08a1988852e036f640ba4 as travis-ci was failing.
The travis-ci test is running on powershell-6.0.0-beta.9 and it looks like Export-Clixml/Import-Clixml is bugged there (Also now it's working without needing a file).
As PS 6.0 is already deprecated maybe it will be good to update the test to use newer version brew update
? I'm not an Apple guy :-)
Hi This pull is to replace in part the outdated pull https://github.com/nohwnd/Assert/pull/34. There are 3 things covered here:
Commit https://github.com/nohwnd/Assert/commit/c7703405086e8b47f56c43da113ff1ffc748a405 - Moved StrictOrder to Get-EquivalencyOption from Assert-Equivalent so it will be in the same place with all the other configuration options.
Commit https://github.com/nohwnd/Assert/commit/6aea1e058bb2261f71f75b51a644284e73f2966f - Deserialize DBNull support added as Deserialize DataTable and DataRow are already supported in the existing version and it is missing to complete the set to make this usable.
Commit https://github.com/nohwnd/Assert/commit/959c9ca38ee7eccbe4d03fc3a485c44b10b2b426 - Added a new -Comparator Option 'StrictEquality' Use this code to illustrate the 3 modes ('Equivalency', 'Equality', 'StrictEquality')
PowerShell 7.0.0-preview.2
PowerShell 5.1
Equivalency - Return true in all the tested situations, using your existing equivalency code. StrictEquality - Return false in all the tested situations, it verifies that the Type is the same in addition to the value test. Equality - Exactly the same as doing
$Expected -eq $Actual
(Can return different results depending on the PS version and the side of the variable ('False' -eq $false
vs$false -eq 'False'
)).Since PowerShell 7.0.0-preview.2 DBNull -eq $null. So in Equality mode the result will depend on the PowerShell version as
[DBNull]::Value -eq $null
will depend on the PowerShell version. In Equivalency mode this inconsistency is fixed to reflect the spirit of PS7 and it will be true in all PS versions. In StrictEquality it will return false as in StrictEquality mode the Types need to be identical to pass.