Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sammdot committed Apr 21, 2021
1 parent acd85f0 commit ec410ad
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
28 changes: 14 additions & 14 deletions src/test_translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ fn test_punct() {
fn test_attach() {
// \cxds: Delete Space
check_tl!("{^}", "\\cxds ");
check_tl!("{^ing}", "\\cxds ing");
check_tl!("{pre^}", "pre\\cxds ");
check_tl!("{^...^}", "\\cxds ...\\cxds ");
check_tl!("{^ing}", "{\\*\\cxplvrortho}\\cxds ing");
check_tl!("{pre^}", "{\\*\\cxplvrortho}pre\\cxds ");
check_tl!("{^...^}", "{\\*\\cxplvrortho}\\cxds ...\\cxds ");

check_tl!("{:attach}", "\\cxds ");
check_tl!("{:attach:^ing}", "\\cxds ing");
check_tl!("{:attach:pre^}", "pre\\cxds ");
check_tl!("{:attach:...}", "\\cxds ...\\cxds ");
check_tl!("{:attach:^ing}", "{\\*\\cxplvrortho}\\cxds ing");
check_tl!("{:attach:pre^}", "{\\*\\cxplvrortho}pre\\cxds ");
check_tl!("{:attach:...}", "{\\*\\cxplvrortho}\\cxds ...\\cxds ");

check_tl!("{^ ^}", "\\~");
}
Expand Down Expand Up @@ -187,14 +187,14 @@ fn test_force_cap() {
#[test]
fn test_carry_cap() {
// \cxplvrccap: Carry CAPitalization
check_tl!("{~|^-^}", "{\\*\\cxplvrccap}\\cxds -\\cxds ");
check_tl!("{~|^-esque}", "{\\*\\cxplvrccap}\\cxds -esque");
check_tl!("{~|un-^}", "{\\*\\cxplvrccap}un-\\cxds ");
check_tl!("{~|^-^}", "{\\*\\cxplvrccap}{\\*\\cxplvrortho}\\cxds -\\cxds ");
check_tl!("{~|^-esque}", "{\\*\\cxplvrccap}{\\*\\cxplvrortho}\\cxds -esque");
check_tl!("{~|un-^}", "{\\*\\cxplvrccap}{\\*\\cxplvrortho}un-\\cxds ");
check_tl!("{~|5}", "{\\*\\cxplvrccap}5");

check_tl!("{:carry_capitalize:^-^}", "{\\*\\cxplvrccap}\\cxds -\\cxds ");
check_tl!("{:carry_capitalize:^-esque}", "{\\*\\cxplvrccap}\\cxds -esque");
check_tl!("{:carry_capitalize:un-^}", "{\\*\\cxplvrccap}un-\\cxds ");
check_tl!("{:carry_capitalize:^-^}", "{\\*\\cxplvrccap}{\\*\\cxplvrortho}\\cxds -\\cxds ");
check_tl!("{:carry_capitalize:^-esque}", "{\\*\\cxplvrccap}{\\*\\cxplvrortho}\\cxds -esque");
check_tl!("{:carry_capitalize:un-^}", "{\\*\\cxplvrccap}{\\*\\cxplvrortho}un-\\cxds ");
check_tl!("{:carry_capitalize:5}", "{\\*\\cxplvrccap}5");
}

Expand All @@ -209,8 +209,8 @@ fn test_currency() {

#[test]
fn test_newline() {
check_tl!("{^\\n^}", "\\cxds \\n\\cxds ");
check_tl!("{^\\t^}", "\\cxds \\t\\cxds ");
check_tl!("{^\\n^}", "{\\*\\cxplvrortho}\\cxds \\n\\cxds ");
check_tl!("{^\\t^}", "{\\*\\cxplvrortho}\\cxds \\t\\cxds ");
}

#[test]
Expand Down
26 changes: 17 additions & 9 deletions src/test_translation_parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,13 @@ fn test_punct() {
#[test]
fn test_attach() {
check_tl!("\\cxds ", "{^}");
check_tl!("\\cxds ing", "{^ing}");
check_tl!("pre\\cxds ", "{pre^}");
check_tl!("\\cxds ...\\cxds ", "{^...^}");
check_tl!("\\cxds ing", "{^}ing");
check_tl!("pre\\cxds ", "pre{^}");
check_tl!("\\cxds ...\\cxds ", "{^}...{^}");

check_tl!("{\\*\\cxplvrortho}\\cxds ing", "{^ing}");
check_tl!("{\\*\\cxplvrortho}pre\\cxds ", "{pre^}");
check_tl!("{\\*\\cxplvrortho}\\cxds ...\\cxds ", "{^...^}");
}

#[test]
Expand Down Expand Up @@ -138,10 +142,14 @@ fn test_force_cap() {

#[test]
fn test_carry_cap() {
check_tl!("{\\*\\cxplvrccap}\\cxds -\\cxds ", "{~|^-^}");
check_tl!("{\\*\\cxplvrccap}\\cxds -esque", "{~|^-esque}");
check_tl!("{\\*\\cxplvrccap}un-\\cxds ", "{~|un-^}");
check_tl!("{\\*\\cxplvrccap}5", "{~|5}");
check_tl!("{\\*\\cxplvrccap}{\\*\\cxplvrortho}\\cxds -\\cxds ", "{~|^-^}");
check_tl!("{\\*\\cxplvrccap}{\\*\\cxplvrortho}\\cxds -esque", "{~|^-esque}");
check_tl!("{\\*\\cxplvrccap}{\\*\\cxplvrortho}un-\\cxds ", "{~|un-^}");

check_tl!("{\\*\\cxplvrccap}\\cxds -\\cxds ", "{~|}{^}-{^}");
check_tl!("{\\*\\cxplvrccap}\\cxds -esque", "{~|}{^}-esque");
check_tl!("{\\*\\cxplvrccap}un-\\cxds ", "{~|}un-{^}");
check_tl!("{\\*\\cxplvrccap}5", "{~|}5");
}

#[test]
Expand All @@ -152,8 +160,8 @@ fn test_currency() {

#[test]
fn test_newline() {
check_tl!("\\cxds \\n\\cxds ", "{^\\n^}");
check_tl!("\\cxds \\t\\cxds ", "{^\\t^}");
check_tl!("{\\*\\cxplvrortho}\\cxds \\n\\cxds ", "{^\\n^}");
check_tl!("{\\*\\cxplvrortho}\\cxds \\t\\cxds ", "{^\\t^}");
}

#[test]
Expand Down

0 comments on commit ec410ad

Please sign in to comment.