()
| 136 | |
| 137 | #[test] |
| 138 | fn leetcode() { |
| 139 | assert_eq!(Solution::is_number(String::from("123")), true); |
| 140 | assert_eq!(Solution::is_number(String::from(" 123 ")), true); |
| 141 | assert_eq!(Solution::is_number(String::from("0")), true); |
| 142 | assert_eq!(Solution::is_number(String::from("0123")), true); //Cannot agree |
| 143 | assert_eq!(Solution::is_number(String::from("00")), true); //Cannot agree |
| 144 | assert_eq!(Solution::is_number(String::from("-10")), true); |
| 145 | assert_eq!(Solution::is_number(String::from("-0")), true); |
| 146 | assert_eq!(Solution::is_number(String::from("123.5")), true); |
| 147 | assert_eq!(Solution::is_number(String::from("123.000000")), true); |
| 148 | assert_eq!(Solution::is_number(String::from("-500.777")), true); |
| 149 | assert_eq!(Solution::is_number(String::from("0.0000001")), true); |
| 150 | assert_eq!(Solution::is_number(String::from("0.00000")), true); |
| 151 | assert_eq!(Solution::is_number(String::from("0.")), true); //Cannot be more disagree!!! |
| 152 | assert_eq!(Solution::is_number(String::from("00.5")), true); //Strongly cannot agree |
| 153 | assert_eq!(Solution::is_number(String::from("123e1")), true); |
| 154 | assert_eq!(Solution::is_number(String::from("1.23e10")), true); |
| 155 | assert_eq!(Solution::is_number(String::from("0.5e-10")), true); |
| 156 | assert_eq!(Solution::is_number(String::from("1.0e4.5")), false); |
| 157 | assert_eq!(Solution::is_number(String::from("0.5e04")), true); |
| 158 | assert_eq!(Solution::is_number(String::from("12 3")), false); |
| 159 | assert_eq!(Solution::is_number(String::from("1a3")), false); |
| 160 | assert_eq!(Solution::is_number(String::from("")), false); |
| 161 | assert_eq!(Solution::is_number(String::from(" ")), false); |
| 162 | assert_eq!(Solution::is_number(String::from(".1")), true); //Ok)), if you say so |
| 163 | assert_eq!(Solution::is_number(String::from(".")), false); |
| 164 | assert_eq!(Solution::is_number(String::from("2e0")), true); //Really?! |
| 165 | assert_eq!(Solution::is_number(String::from("+.8")), true); |
| 166 | assert_eq!(Solution::is_number(String::from(" 005047e+6")), true); //Damn = =||| |
| 167 | } |
| 168 | } |
nothing calls this directly
no outgoing calls
no test coverage detected