Александър качи първо решение на 10.01.2022 18:43 (преди над 3 години)
Кода ти не се компилира -- сложил си всичкия код в модул tests
, така че тестовете няма как да го импортнат.
Към профила на Александър Бакалов
Compiling solution v0.1.0 (/tmp/d20220116-3533338-jpel23/solution) warning: unused import: `std::io::BufReader` --> src/lib.rs:4:5 | 4 | use std::io::BufReader; | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused import: `std::fs::File` --> src/lib.rs:5:5 | 5 | use std::fs::File; | ^^^^^^^^^^^^^ warning: constant is never used: `TEST_INPUT_1` --> src/lib.rs:310:1 | 310 | / const TEST_INPUT_1: &str = " 311 | | ## Rooms 312 | | - Entrance 313 | | - Hallway ... | 316 | | - Entrance -> East -> Hallway 317 | | "; | |__^ | = note: `#[warn(dead_code)]` on by default warning: `solution` (lib) generated 3 warnings Finished test [unoptimized + debuginfo] target(s) in 3.79s Running tests/solution_test.rs (target/debug/deps/solution_test-2e292b23ac75572c) running 15 tests test solution_test::test_adding_rooms_1 ... ok test solution_test::test_adding_rooms_2 ... ok test solution_test::test_cyrillic_room_names ... ok test solution_test::test_finding_a_direct_path ... ok test solution_test::test_finding_a_reflexive_path ... FAILED test solution_test::test_finding_an_indirect_path ... ok test solution_test::test_finding_no_path ... ok test solution_test::test_invalid_parsing ... FAILED test solution_test::test_io_error ... ok test solution_test::test_overwriting_a_room_link ... ok test solution_test::test_parsing_cyrillic_rooms ... ok test solution_test::test_parsing_no_rooms_or_links ... ok test solution_test::test_parsing_rooms ... ok test solution_test::test_room_errors ... ok test solution_test::test_room_links ... ok failures: ---- solution_test::test_finding_a_reflexive_path stdout ---- thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', tests/solution_test.rs:360:71 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', tests/solution_test.rs:354:5 ---- solution_test::test_invalid_parsing stdout ---- thread 'main' panicked at 'assertion failed: matches!(Dungeon :: from_reader(\"\".as_bytes()),\n Err(Errors :: LineParseError { line_number : 0 }))', tests/solution_test.rs:276:5 failures: solution_test::test_finding_a_reflexive_path solution_test::test_invalid_parsing test result: FAILED. 13 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s error: test failed, to rerun pass '--test solution_test'
Кода ти не се компилира -- сложил си всичкия код в модул tests
, така че тестовете няма как да го импортнат.