From 3d57590b88371d6253e77326cfefa112bcdf7c23 Mon Sep 17 00:00:00 2001 From: Pyfisch Date: Sun, 19 Jul 2015 14:39:34 +0200 Subject: [PATCH] improve tests, add code source to LICENSE --- LICENSE | 4 ++++ src/lib.rs | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index b1b75fa..87ad0c2 100644 --- a/LICENSE +++ b/LICENSE @@ -17,3 +17,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +The code is based on the charset implementation of hyper: +https://github.com/hyperium/hyper/blob/7b108466f6a53d0ffdc6c7889d1a01fca251e462/src/header/shared/charset.rs +licensed under MIT, written by seanmonstar, SBSTP, hugoduncan, fhartwig and Pyfisch. diff --git a/src/lib.rs b/src/lib.rs index 8f92d1d..6097f77 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -201,12 +201,14 @@ mod tests { #[test] fn test_display() { - assert_eq!("US-ASCII", format!("{}", UsAscii)); - assert_eq!("ABCD", format!("{}", Unregistered("ABCD".to_owned()))); + assert_eq!("US-ASCII", UsAscii.to_string()); + assert_eq!("ABCD", Unregistered("ABCD".to_owned()).to_string()); } #[test] fn test_cmp() { + assert!(Iso88593 == Iso88593); + assert!(UsAscii != Iso88593); assert_eq!(Unregistered("foobar".to_owned()), Unregistered("FOOBAR".to_owned())); } }