MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / test_decode_error

Function test_decode_error

chirpstack/src/codec/js/mod.rs:203–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
decodeFunction · 0.70

Tested by

no test coverage detected