Verify.Cli
1.0.374
Prefix Reserved
See the version list below for details.
dotnet tool install --global Verify.Cli --version 1.0.374
dotnet new tool-manifest
dotnet tool install --local Verify.Cli --version 1.0.374
#tool dotnet:?package=Verify.Cli&version=1.0.374
nuke :add-package Verify.Cli --version 1.0.374
Verify.Cli
A command-line tool that uses the Verify library for regular files (without requiring you to create a unit test project).
Usage
If you run this tool interactively, then you'll get a similar experience that you would using VerifyTests in a .NET unit test project. Verify.Cli will utilise any existing compatible file diff tool to display the diff.
./Verify.Cli --file <path to file to verify> [--verified-dir <directory>]
The first time you use Verify.Cli, it will output the contents of the file.
Options
--file
or-f
: The file to verify (required)--verified-dir
or-d
: Directory to store/look for .verified files (optional)
Examples
Basic usage:
.\Verify.Cli.exe --file C:\tmp\example.txt
With custom verified files directory:
.\Verify.Cli.exe --file C:\tmp\example.txt --verified-dir C:\MyVerifiedFiles
This will look for the verified file at C:\MyVerifiedFiles\example.txt.verified.txt
instead of the default location next to the source file.
When the files match, the tool exits with code 0 and produces no output.
Unhandled exception: VerifyException: Directory: C:\tmp
New:
- Received: example.txt.received.txt
Verified: example.txt.verified.txt
FileContent:
New:
Received: example.txt.received.txt
This is
a text file.
Your diff tool of choice (if found by the Verify's DiffEngine library) can then be used to compare to the verified file (if it exists), or create it (if the first time).
If the verified file matches the received file, then there is no output (and the exit code is zero).
If the received file is different from the verified file, then a diff will be shown in the console, a non-zero exit code will be returned, and if in an interactive environment with a supported diff tool, then that tool will be launched.
Unhandled exception: VerifyException: Directory: C:\tmp
NotEqual:
- Received: example.txt.received.txt
Verified: example.txt.verified.txt
FileContent:
NotEqual:
Received: example.txt.received.txt
This is
an updated text file.
Verified: example.txt.verified.txt
This is
a text file.
Example with Beyond Compare launched:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.