// // Copyright (c) 2021 chiya.dev // // Use of this source code is governed by the MIT License // which can be found in the LICENSE file and at: // // https://opensource.org/licenses/MIT // use laby::{internal::escape_str, *}; #[test] fn all() { let s = escape_str("&\"'<>"); assert_eq!(s, "&"'<>"); } #[test] fn unicode() { let s = "이건 이스케이프 처리하지마"; assert_eq!(s, escape_str(s)); let s = "これもエスケープするな"; assert_eq!(s, escape_str(s)); let s = "これち&ゃんと\"エ'スケ<ープ>できる?"; assert_eq!( "これち&ゃんと"エ'スケ<ープ>できる?", escape_str(s) ); let s = "<잘 &동&작해&&서 다\"행\"이네!>ㅇ"; assert_eq!( "<잘 &동&작해&&서 다"행"이네!>ㅇ", escape_str(s) ); } #[test] fn child() { let s = ""; let n = render!(div!(s)); assert_eq!(n, "