mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 00:57:26 +00:00
Consolidate related support tests
This commit is contained in:
@@ -244,7 +244,7 @@ NFC/NFD lookup with original ranges, suggestions and pack hyphenation. The opt-i
|
||||
dictionary gate fails when its input is missing; it never silently skips its assertions:
|
||||
|
||||
```sh
|
||||
WORDCRAFT_DICTIONARIES=/absolute/isolated/french-dictionary cargo test -p craft-proof --test french_dictionary -- --ignored
|
||||
WORDCRAFT_DICTIONARIES=/absolute/isolated/french-dictionary cargo test -p craft-proof --test it -- french_dictionary:: --ignored
|
||||
```
|
||||
|
||||
For a reproducible real-dictionary run, use Dicollecte 7.7 from LibreOffice/dictionaries
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@
|
||||
use craft_proof::affix::{AffixDict, capitalize};
|
||||
use std::fmt::Write;
|
||||
|
||||
#[path = "fixtures/affix_compatibility_cases.rs"]
|
||||
#[path = "../fixtures/affix_compatibility_cases.rs"]
|
||||
mod fixtures;
|
||||
|
||||
fn snapshot(case: &fixtures::Case, dict: &AffixDict) -> String {
|
||||
@@ -47,7 +47,7 @@ fn snapshot(case: &fixtures::Case, dict: &AffixDict) -> String {
|
||||
|
||||
#[test]
|
||||
fn non_french_affix_outputs_match_pre_french_baseline() {
|
||||
let expected = include_str!("fixtures/affix_compatibility.expected");
|
||||
let expected = include_str!("../fixtures/affix_compatibility.expected");
|
||||
let mut actual = String::new();
|
||||
for case in fixtures::cases() {
|
||||
let dict = AffixDict::from_hunspell(&case.aff, &case.dic, &["original compatibility fixture"]).unwrap();
|
||||
@@ -80,7 +80,7 @@ fn non_french_affix_outputs_match_pre_french_baseline() {
|
||||
|
||||
#[test]
|
||||
fn legacy_compact_data_is_refused_without_reinterpreting_homonyms() {
|
||||
let encoded = include_str!("fixtures/affix_compatibility.compact");
|
||||
let encoded = include_str!("../fixtures/affix_compatibility.compact");
|
||||
let cases = fixtures::cases();
|
||||
let lines: Vec<_> = encoded.lines().collect();
|
||||
assert_eq!(lines.len(), cases.len());
|
||||
@@ -1,11 +1,10 @@
|
||||
//! French uses ordinary Language packs and keeps each regional locale at the public API.
|
||||
#![allow(clippy::unwrap_used, clippy::expect_used)]
|
||||
|
||||
use craft_proof::affix;
|
||||
use craft_proof::{IssueKind, Options, ProofLang, check_text_with, is_correct_in_with, suggest_in};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
#[path = "../src/fr/test_dict.rs"]
|
||||
#[path = "../../src/fr/test_dict.rs"]
|
||||
mod fixture;
|
||||
|
||||
struct Tools(PathBuf);
|
||||
@@ -0,0 +1,8 @@
|
||||
//! The crate's integration tests, linked into one test binary.
|
||||
|
||||
// The shared French dictionary fixture refers to the affix module through the crate root.
|
||||
use craft_proof::affix;
|
||||
|
||||
mod affix_compatibility;
|
||||
mod french_dictionary;
|
||||
mod french_packs;
|
||||
@@ -0,0 +1,4 @@
|
||||
//! The crate's integration tests, linked into one test binary.
|
||||
|
||||
mod guards;
|
||||
mod source_limits;
|
||||
Reference in New Issue
Block a user