Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: include newer versions of languagetool in tests #126

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/rustlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tag: [latest, '5.5', '5.6', '5.7', '5.8', '5.9', '6.0', '6.1']
tag: [latest, '5.5', '5.6', '5.7', '5.8', '5.9', '6.0', '6.1', '6.2', '6.3', '6.4', '6.5']
runs-on: ubuntu-latest
services:
languagetool:
Expand All @@ -51,4 +51,4 @@ jobs:
uses: Swatinem/rust-cache@v2

- run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- run: cargo nextest run --all-features
- run: cargo nextest run --all-features --no-capture
14 changes: 9 additions & 5 deletions src/api/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,19 +594,23 @@ impl ServerClient {
#[cfg(test)]
mod tests {
use super::ServerClient;
use crate::api::check::Request;
use crate::{api::check::Request, error};

fn dbg_err(e: &error::Error) {
eprintln!("Error: {e:?}")
}

#[tokio::test]
async fn test_server_ping() {
let client = ServerClient::from_env_or_default();
assert!(client.ping().await.is_ok());
assert!(client.ping().await.inspect_err(dbg_err).is_ok());
}

#[tokio::test]
async fn test_server_check_text() {
let client = ServerClient::from_env_or_default();
let req = Request::default().with_text("je suis une poupee");
assert!(client.check(&req).await.is_ok());
assert!(client.check(&req).await.inspect_err(dbg_err).is_ok());
}

#[tokio::test]
Expand All @@ -615,12 +619,12 @@ mod tests {
let req = Request::default()
.with_data_str("{\"annotation\":[{\"text\": \"je suis une poupee\"}]}")
.unwrap();
assert!(client.check(&req).await.is_ok());
assert!(client.check(&req).await.inspect_err(dbg_err).is_ok());
}

#[tokio::test]
async fn test_server_languages() {
let client = ServerClient::from_env_or_default();
assert!(client.languages().await.is_ok());
assert!(client.languages().await.inspect_err(dbg_err).is_ok());
}
}
Loading