Skip to content

Commit 69c060d

Browse files
authored
Attempt to fix the problem with tests in the web editor. (#162)
1 parent 6c52fb9 commit 69c060d

File tree

94 files changed

+470
-94
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+470
-94
lines changed

bin/exercise_test.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
$slug=Split-Path $PSScriptRoot -Leaf
22
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
3+
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue
34

4-
if (![System.IO.File]::Exists("$cobolcheck")){
5+
if ($cobolcheckCmd) {
6+
$cobolcheck = $cobolcheckCmd.Path
7+
Write-Output "Found cobolcheck, using $cobolcheck"
8+
} elseif (![System.IO.File]::Exists("$cobolcheck")){
59
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
610
echo $fetchCobolcheckPath
711
Write-Output "Cobolcheck not found. Trying to fetch it."

bin/exercise_test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
33
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
44
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"
55

6-
if [ ! -f "${COBOLCHECK}" ]; then
6+
WHICH_COBOLCHECK=$(which cobolcheck)
7+
if [[ $? -eq 0 ]] ; then
8+
echo "Found cobolcheck, using $COBOLCHECK"
9+
COBOLCHECK=$WHICH_COBOLCHECK
10+
elif [ ! -f "${COBOLCHECK}" ]; then
711
echo "Cobolcheck not found, try to fetch it."
812
cd $SCRIPT_DIR/bin/
913
bash fetch-cobolcheck

exercises/practice/acronym/test.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
$slug=Split-Path $PSScriptRoot -Leaf
22
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
3+
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue
34

4-
if (![System.IO.File]::Exists("$cobolcheck")){
5+
if ($cobolcheckCmd) {
6+
$cobolcheck = $cobolcheckCmd.Path
7+
Write-Output "Found cobolcheck, using $cobolcheck"
8+
} elseif (![System.IO.File]::Exists("$cobolcheck")){
59
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
610
echo $fetchCobolcheckPath
711
Write-Output "Cobolcheck not found. Trying to fetch it."

exercises/practice/acronym/test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
33
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
44
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"
55

6-
if [ ! -f "${COBOLCHECK}" ]; then
6+
WHICH_COBOLCHECK=$(which cobolcheck)
7+
if [[ $? -eq 0 ]] ; then
8+
echo "Found cobolcheck, using $COBOLCHECK"
9+
COBOLCHECK=$WHICH_COBOLCHECK
10+
elif [ ! -f "${COBOLCHECK}" ]; then
711
echo "Cobolcheck not found, try to fetch it."
812
cd $SCRIPT_DIR/bin/
913
bash fetch-cobolcheck

exercises/practice/all-your-base/test.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
$slug=Split-Path $PSScriptRoot -Leaf
22
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
3+
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue
34

4-
if (![System.IO.File]::Exists("$cobolcheck")){
5+
if ($cobolcheckCmd) {
6+
$cobolcheck = $cobolcheckCmd.Path
7+
Write-Output "Found cobolcheck, using $cobolcheck"
8+
} elseif (![System.IO.File]::Exists("$cobolcheck")){
59
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
610
echo $fetchCobolcheckPath
711
Write-Output "Cobolcheck not found. Trying to fetch it."

exercises/practice/all-your-base/test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
33
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
44
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"
55

6-
if [ ! -f "${COBOLCHECK}" ]; then
6+
WHICH_COBOLCHECK=$(which cobolcheck)
7+
if [[ $? -eq 0 ]] ; then
8+
echo "Found cobolcheck, using $COBOLCHECK"
9+
COBOLCHECK=$WHICH_COBOLCHECK
10+
elif [ ! -f "${COBOLCHECK}" ]; then
711
echo "Cobolcheck not found, try to fetch it."
812
cd $SCRIPT_DIR/bin/
913
bash fetch-cobolcheck

exercises/practice/allergies/test.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
$slug=Split-Path $PSScriptRoot -Leaf
22
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
3+
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue
34

4-
if (![System.IO.File]::Exists("$cobolcheck")){
5+
if ($cobolcheckCmd) {
6+
$cobolcheck = $cobolcheckCmd.Path
7+
Write-Output "Found cobolcheck, using $cobolcheck"
8+
} elseif (![System.IO.File]::Exists("$cobolcheck")){
59
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
610
echo $fetchCobolcheckPath
711
Write-Output "Cobolcheck not found. Trying to fetch it."

exercises/practice/allergies/test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
33
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
44
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"
55

6-
if [ ! -f "${COBOLCHECK}" ]; then
6+
WHICH_COBOLCHECK=$(which cobolcheck)
7+
if [[ $? -eq 0 ]] ; then
8+
echo "Found cobolcheck, using $COBOLCHECK"
9+
COBOLCHECK=$WHICH_COBOLCHECK
10+
elif [ ! -f "${COBOLCHECK}" ]; then
711
echo "Cobolcheck not found, try to fetch it."
812
cd $SCRIPT_DIR/bin/
913
bash fetch-cobolcheck

exercises/practice/anagram/test.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
$slug=Split-Path $PSScriptRoot -Leaf
22
$cobolcheck = Join-Path -Path "${HOME}" "cobolcheck" "cobolcheck.exe"
3+
$cobolcheckCmd = Get-Command "cobolcheck.exe" -ErrorAction SilentlyContinue
34

4-
if (![System.IO.File]::Exists("$cobolcheck")){
5+
if ($cobolcheckCmd) {
6+
$cobolcheck = $cobolcheckCmd.Path
7+
Write-Output "Found cobolcheck, using $cobolcheck"
8+
} elseif (![System.IO.File]::Exists("$cobolcheck")){
59
$fetchCobolcheckPath = Join-Path -Path "${PSScriptRoot}" "bin" "fetch-cobolcheck.ps1"
610
echo $fetchCobolcheckPath
711
Write-Output "Cobolcheck not found. Trying to fetch it."

exercises/practice/anagram/test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/
33
SLUG=${1:-$(basename "${SCRIPT_DIR}")}
44
COBOLCHECK="${HOME}/cobolcheck/cobolcheck"
55

6-
if [ ! -f "${COBOLCHECK}" ]; then
6+
WHICH_COBOLCHECK=$(which cobolcheck)
7+
if [[ $? -eq 0 ]] ; then
8+
echo "Found cobolcheck, using $COBOLCHECK"
9+
COBOLCHECK=$WHICH_COBOLCHECK
10+
elif [ ! -f "${COBOLCHECK}" ]; then
711
echo "Cobolcheck not found, try to fetch it."
812
cd $SCRIPT_DIR/bin/
913
bash fetch-cobolcheck

0 commit comments

Comments
 (0)