a better coloring crate
Diffstat (limited to 'tests/basic.rs')
| -rw-r--r-- | tests/basic.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basic.rs b/tests/basic.rs new file mode 100644 index 0000000..594df32 --- /dev/null +++ b/tests/basic.rs @@ -0,0 +1,12 @@ +use comat::comat; +#[test] +fn basic() { + assert_eq!(comat!("{red}yes{reset}"), "\x1b[0;34;31myes\x1b[0m"); + assert_eq!(comat!("{thing:red}"), "\x1b[0m\x1b[0;34;31m{thing}\x1b[0m"); +} + +#[test] +fn escapes() { + assert_eq!(comat!("{{ow}} {{red}}"), "{ow} {red}"); + assert_eq!(comat!("{{{{"), "{{"); +} |