gwy15 / danmu2ass

将哔哩哔哩的 弹幕 转化为 ass 字幕文件,实时预览
MIT License
122 stars 8 forks source link

release 模式构建时测试失败 #11

Closed skbeh closed 1 year ago

skbeh commented 1 year ago

不加 --release 时测试通过。

$ cargo test --release
Compiling danmu2ass v0.2.2
Finished release [optimized] target(s) in 1.17s
Running unittests src/lib.rs (target/release/deps/danmu2ass-2c26aa49fb432fe9)

running 7 tests
test ass_writer::tests::test_escape_text ... ok
test ass_writer::tests::time_point_fmt ... ok
test input_type::tests::parse_bv ... ok
test xml_parser::tests::from_xml ... ok
test input_type::tests::parse_season_or_episode ... ok
test xml_parser::tests::parse_break_line ... FAILED
test xml_parser::tests::iterator ... FAILED

failures:

---- xml_parser::tests::parse_break_line stdout ----
thread 'xml_parser::tests::parse_break_line' panicked at 'assertion failed: `(left == right)`
left: `"呵\n呵\n比\n你\n们\n更\n喜\n欢\n晚\n晚"`,
right: `"0-呵\n呵\n比\n你\n们\n更\n喜\n欢\n晚\n晚"`', src/xml_parser.rs:357:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- xml_parser::tests::iterator stdout ----
thread 'xml_parser::tests::iterator' panicked at 'assertion failed: `(left == right)`
left: `Danmu { timeline_s: 0.581, content: "快快快", type: Float, fontsize: 25, rgb: (227, 63, 255) }`,
right: `Danmu { timeline_s: 0.581, content: "0-快快快", type: Float, fontsize: 25, rgb: (227, 63, 255) }`', src/xml_parser.rs:325:9

failures:
xml_parser::tests::iterator
xml_parser::tests::parse_break_line

test result: FAILED. 5 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass `--lib`
gwy15 commented 1 year ago

预期内行为,目前 test 只会在 debug profile 下跑