standardize workflow test pattern
This commit is contained in:
11
__tests__/verify-java.ps1
Normal file
11
__tests__/verify-java.ps1
Normal file
@ -0,0 +1,11 @@
|
||||
if (!$args.Count -or !$args[0])
|
||||
{
|
||||
throw "Must supply java version argument"
|
||||
}
|
||||
|
||||
$java_version = & cmd.exe /c "java -version 2>&1" | Out-String
|
||||
Write-Host "Found java version: $java_version"
|
||||
if (!$java_version.Contains($args[0]))
|
||||
{
|
||||
throw "Unexpected version"
|
||||
}
|
13
__tests__/verify-java.sh
Executable file
13
__tests__/verify-java.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Must supply java version argument"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
java_version="$(java -version 2>&1)"
|
||||
echo "Found java version: $java_version"
|
||||
if [ -z "$(echo $java_version | grep --fixed-strings $1)" ]; then
|
||||
echo "Unexpected version"
|
||||
exit 1
|
||||
fi
|
Reference in New Issue
Block a user