mozilla / janus-plugin-rs

Rust crate for wrapping the Janus C plugin API, so you can build Janus plugins in Rust.
Mozilla Public License 2.0
47 stars 18 forks source link

Add tests for log colored output #3

Closed ivanovaleksey closed 7 years ago

ivanovaleksey commented 7 years ago

Hi @mquander,

I thought about test yesterday but I wasn't sure how I could check that string was really colored.

Today I realized that I could just check color's codes in string. It seems to work fine: fails on before-patch version and passes on after-patch one.

I also added function to build default LogParameters struct. Not sure if it's a common practice in Rust but it seems to be rather convenient and helps to avoid duplication.

mqp commented 7 years ago

Looks good -- I agree that just checking the color codes like this seems like the right approach. Thanks for adding these!