From ec410adc9fa8bcf9002d7485172befc3417c4edd Mon Sep 17 00:00:00 2001 From: Sammi De Guzman Date: Wed, 21 Apr 2021 01:39:27 -0700 Subject: [PATCH] Fix tests --- src/test_translation.rs | 28 ++++++++++++++-------------- src/test_translation_parse.rs | 26 +++++++++++++++++--------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/test_translation.rs b/src/test_translation.rs index 3e01516..18c46a8 100644 --- a/src/test_translation.rs +++ b/src/test_translation.rs @@ -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!("{^ ^}", "\\~"); } @@ -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"); } @@ -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] diff --git a/src/test_translation_parse.rs b/src/test_translation_parse.rs index 00e09e5..4b2116c 100644 --- a/src/test_translation_parse.rs +++ b/src/test_translation_parse.rs @@ -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] @@ -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] @@ -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]