m-bus-parser-wasm-pack 0.0.10

A wasm-pack to use the library for parsing M-Bus frames
Documentation
//! Test suite for the Web and headless browsers.

#![cfg(target_arch = "wasm32")]

extern crate wasm_bindgen_test;
use wasm_bindgen_test::*;

wasm_bindgen_test_configure!(run_in_browser);

#[wasm_bindgen_test]
fn pass() {
    assert_eq!(1 + 1, 2);
}

#[wasm_bindgen_test]
fn test_m_bus_parse_table() {
    let input = "68 3D 3D 68 08 01 72 00 51 20 02 82 4D 02 04 00 88 00 00 04 07 00 00 00 00 0C 15 03 00 00 00 0B 2E 00 00 00 0B 3B 00 00 00 0A 5A 88 12 0A 5E 16 05 0B 61 23 77 00 02 6C 8C 11 02 27 37 0D 0F 60 00 67 16";
    let output = m_bus_parser_wasm_pack::m_bus_parse(input, "table_format");
    assert!(output.contains("Long Frame"));
    assert!(output.contains("RspUd (ACD: false, DFC: false)"));
    assert!(output.contains("02205100"));
    assert!(output.contains("[Wh]"));
}