Кирил качи първо решение на 26.11.2018 13:32 (преди почти 7 години)
Добра работа, жалко за typo-то :)
Compiling solution v0.1.0 (/tmp/d20190123-22631-14g7a8l/solution)
Finished dev [unoptimized + debuginfo] target(s) in 4.99s
Running target/debug/deps/solution-2e785d603b538f71
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running target/debug/deps/solution_test-29808948fb50ed3a
running 15 tests
test solution_test::test_equailty_symmetry ... ok
test solution_test::test_equality_basic ... ok
test solution_test::test_equality_floating ... ok
test solution_test::test_line_constructors ... ok
test solution_test::test_line_equality_by_points ... ok
test solution_test::test_line_equality_by_points_and_vectors ... FAILED
test solution_test::test_line_equality_by_vectors ... FAILED
test solution_test::test_line_validity ... ok
test solution_test::test_number_by_vector ... ok
test solution_test::test_number_vector_multiplication_with_precision ... ok
test solution_test::test_point_distance ... ok
test solution_test::test_points_minus_points ... ok
test solution_test::test_points_plus_vectors ... ok
test solution_test::test_vector_by_vector ... ok
test solution_test::test_vector_by_vector_cross ... FAILED
failures:
---- solution_test::test_line_equality_by_points_and_vectors stdout ----
thread 'solution_test::test_line_equality_by_points_and_vectors' panicked at 'assertion failed: `(left == right)`
left: `Some(Line { p1: Point { x: 0.0, y: 0.0, z: 0.0 }, p2: Point { x: 0.3, y: -0.1, z: 0.25 }, v: Vector { x: 0.3, y: -0.1, z: 0.25 } })`,
right: `Some(Line { p1: Point { x: 0.0, y: 0.0, z: 0.0 }, p2: Point { x: 0.3, y: -0.1, z: 0.25 }, v: Vector { x: 0.3, y: -0.1, z: 0.25 } })`', tests/solution_test.rs:243:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
---- solution_test::test_line_equality_by_vectors stdout ----
thread 'solution_test::test_line_equality_by_vectors' panicked at 'assertion failed: `(left == right)`
left: `Some(Line { p1: Point { x: 0.0, y: 0.4, z: 0.0 }, p2: Point { x: 0.1, y: 0.2, z: 0.5 }, v: Vector { x: 0.1, y: -0.2, z: 0.5 } })`,
right: `Some(Line { p1: Point { x: 0.0, y: 0.4, z: 0.0 }, p2: Point { x: 0.2, y: 0.0, z: 1.0 }, v: Vector { x: 0.2, y: -0.4, z: 1.0 } })`', tests/solution_test.rs:226:5
---- solution_test::test_vector_by_vector_cross stdout ----
thread 'solution_test::test_vector_by_vector_cross' panicked at 'assertion failed: `(left == right)`
left: `Vector { x: -4.0, y: 5.0, z: -4.0 }`,
right: `Vector { x: -4.0, y: 8.0, z: -4.0 }`', tests/solution_test.rs:136:5
failures:
solution_test::test_line_equality_by_points_and_vectors
solution_test::test_line_equality_by_vectors
solution_test::test_vector_by_vector_cross
test result: FAILED. 12 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--test solution_test'
Добра работа, жалко за typo-то :)
Това може да се опрости до
Vector { x, y, z }, понеже ключовете и променливите имат едни и същи имена.Cool, ще гледам да го ползвам
Близко, но съвсем леко грешно:
Един sanity-check е, че никоя колона няма повторения -- това
yна втория ред трябва да еx.Хората са го казали - бързата работа - срам за майстора... Ако не го беше пойнтаутнал щях много да се чудя. Мерси