-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Describe "opennlp.bat Tests" { | ||
|
||
# Setup before all tests | ||
BeforeAll { | ||
$env:PATH = "$env:OPENNLP_HOME\bin;$env:PATH" | ||
} | ||
|
||
# Test if opennlp.bat is accessible and executable | ||
It "opennlp.bat exists and is executable" { | ||
$batFile = Join-Path $env:OPENNLP_HOME "bin\opennlp.bat" | ||
$batFile | Should -Exist | ||
|
||
# Check if the bat file is executable (on Windows, this means it's a valid executable script) | ||
$result = & $batFile -h | ||
$result | Should -Not -BeNullOrEmpty | ||
} | ||
|
||
# Test the output of SimpleTokenizer | ||
It "SimpleTokenizer produces correct output" { | ||
$input = "Hello, friends" | ||
$expected_output = "Hello , friends" | ||
|
||
# Run the opennlp.bat with SimpleTokenizer | ||
$output = & "$env:OPENNLP_HOME\bin\opennlp.bat" SimpleTokenizer <<< $input | ||
|
||
# Debugging: Log the output | ||
Write-Host "Output: $output" | ||
|
||
# Validate the command executed successfully | ||
$output | Should -Not -BeNullOrEmpty | ||
$output | Should -Contain $expected_output | ||
} | ||
|
||
# Cleanup after tests | ||
AfterAll { | ||
Remove-Item Env:\PATH -ErrorAction SilentlyContinue | ||
} | ||
} |