2020-03-23 03:08:41 +01:00
|
|
|
// ██████╗ █████╗ ███████╗███████╗██╗███╗ ██╗ ██████╗
|
|
|
|
// ██╔══██╗██╔══██╗██╔════╝██╔════╝██║████╗ ██║██╔════╝
|
|
|
|
// ██████╔╝███████║███████╗███████╗██║██╔██╗ ██║██║ ███╗
|
|
|
|
// ██╔═══╝ ██╔══██║╚════██║╚════██║██║██║╚██╗██║██║ ██║
|
|
|
|
// ██║ ██║ ██║███████║███████║██║██║ ╚████║╚██████╔╝
|
|
|
|
// ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝╚═╝ ╚═══╝ ╚═════╝
|
|
|
|
|
2020-05-23 09:49:04 +02:00
|
|
|
#[cfg(test)]
|
|
|
|
mod passing {
|
2021-10-17 09:16:37 +02:00
|
|
|
use monolith::js;
|
2020-03-23 03:08:41 +01:00
|
|
|
|
2020-05-23 09:49:04 +02:00
|
|
|
#[test]
|
|
|
|
fn onblur_camelcase() {
|
|
|
|
assert!(js::attr_is_event_handler("onBlur"));
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn onclick_lowercase() {
|
|
|
|
assert!(js::attr_is_event_handler("onclick"));
|
|
|
|
}
|
2020-03-23 03:08:41 +01:00
|
|
|
|
2020-05-23 09:49:04 +02:00
|
|
|
#[test]
|
|
|
|
fn onclick_camelcase() {
|
|
|
|
assert!(js::attr_is_event_handler("onClick"));
|
|
|
|
}
|
2020-03-23 03:08:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ███████╗ █████╗ ██╗██╗ ██╗███╗ ██╗ ██████╗
|
|
|
|
// ██╔════╝██╔══██╗██║██║ ██║████╗ ██║██╔════╝
|
|
|
|
// █████╗ ███████║██║██║ ██║██╔██╗ ██║██║ ███╗
|
|
|
|
// ██╔══╝ ██╔══██║██║██║ ██║██║╚██╗██║██║ ██║
|
|
|
|
// ██║ ██║ ██║██║███████╗██║██║ ╚████║╚██████╔╝
|
|
|
|
// ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝╚═╝╚═╝ ╚═══╝ ╚═════╝
|
|
|
|
|
2020-05-23 09:49:04 +02:00
|
|
|
#[cfg(test)]
|
|
|
|
mod failing {
|
2021-10-17 09:16:37 +02:00
|
|
|
use monolith::js;
|
2020-03-23 03:08:41 +01:00
|
|
|
|
2020-05-23 09:49:04 +02:00
|
|
|
#[test]
|
|
|
|
fn href() {
|
|
|
|
assert!(!js::attr_is_event_handler("href"));
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn empty_string() {
|
|
|
|
assert!(!js::attr_is_event_handler(""));
|
|
|
|
}
|
2020-03-23 03:08:41 +01:00
|
|
|
|
2020-05-23 09:49:04 +02:00
|
|
|
#[test]
|
|
|
|
fn class() {
|
|
|
|
assert!(!js::attr_is_event_handler("class"));
|
|
|
|
}
|
2020-03-23 03:08:41 +01:00
|
|
|
}
|