From 577c2aa5444db727c23ceae565a8648d6f6a41f4 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 9 Dec 2021 17:28:18 +0000 Subject: add tests for to_ansi --- minecraft-chat/tests/integration_test.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'minecraft-chat/tests') diff --git a/minecraft-chat/tests/integration_test.rs b/minecraft-chat/tests/integration_test.rs index 9fd9c093..0574861b 100644 --- a/minecraft-chat/tests/integration_test.rs +++ b/minecraft-chat/tests/integration_test.rs @@ -6,10 +6,11 @@ fn test() { let j: Value = serde_json::from_str( r#"{ "text": "hello", - "color": "red" + "color": "red", + "bold": true }"#, ) .unwrap(); let component = Component::new(&j).unwrap(); - println!("println: {}", component.to_ansi(None)); + assert_eq!(component.to_ansi(None), "\x1b[38;2;255;85;85mhello\x1b[m"); } -- cgit v1.2.3