| 201 | |
| 202 | #[tokio::test] |
| 203 | pub async fn test_decode_error() { |
| 204 | let decoder = r#" |
| 205 | function decodeUplink(input) { |
| 206 | return foo; |
| 207 | } |
| 208 | "# |
| 209 | .to_string(); |
| 210 | |
| 211 | let vars: HashMap<String, String> = HashMap::new(); |
| 212 | let out = decode(Utc::now(), 10, &vars, &decoder, &[0x01, 0x02, 0x03]).await; |
| 213 | |
| 214 | assert_eq!( |
| 215 | "JS error: Error: foo is not defined\n at decodeUplink (main:5:1)\n at <anonymous> (main:10:37)\n", |
| 216 | out.err().unwrap().to_string() |
| 217 | ); |
| 218 | } |
| 219 | |
| 220 | #[tokio::test] |
| 221 | pub async fn test_decode_buffer_ieee754() { |