improve tests, add code source to LICENSE

This commit is contained in:
Pyfisch 2015-07-19 14:39:34 +02:00
parent 09099a5298
commit 3d57590b88
2 changed files with 8 additions and 2 deletions

View File

@ -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.

View File

@ -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()));
}
}