Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b43aa96
Print failure message on all tests that should panic, but don't
johanngan Jan 10, 2021
679f6f3
Add `unwrap_unchecked()` methods for `Option` and `Result`
ojeda Jan 10, 2021
76299b3
Add `SAFETY` annotations
ojeda Jan 10, 2021
63a1eee
Reset LateContext enclosing body in nested items
camsteffen Jan 18, 2021
21fb586
Query for TypeckResults in LateContext::qpath_res
camsteffen Jan 18, 2021
def0e9b
Fix ICE with `ReadPointerAsBytes` validation error
camelid Jan 11, 2021
a7b7a43
Move test to `src/test/ui/consts/`
camelid Jan 11, 2021
eaba3da
Remove qpath_res util function
camsteffen Jan 18, 2021
e25959b
Make more traits of the From/Into family diagnostic items
flip1995 Jan 22, 2021
48f9dbf
clean up some const error reporting around promoteds
RalfJung Jan 24, 2021
6d4e03a
codegen: assume constants cannot fail to evaluate
RalfJung Jan 24, 2021
2be1993
Ignore test on 32-bit architectures
camelid Jan 25, 2021
59195a2
rustc_codegen_ssa: use wall time for codegen_to_LLVM_IR time-passes e…
tgnottingham Jan 25, 2021
26b4baf
Point to span of upvar making closure FnMut
sledgehammervampire Jan 18, 2021
088c89d
Account for generics when suggesting bound
estebank Jan 19, 2021
042facb
Fix some bugs reported by eslint
GuillaumeGomez Jan 23, 2021
0140dac
Link the reference about undefined behavior
ojeda Jan 25, 2021
01250fc
Add tracking issue
ojeda Jan 25, 2021
1c0a52d
rustdoc: Document CommonMark extensions.
ehuss Jan 25, 2021
6880d11
Rollup merge of #80868 - johanngan:should-panic-msg-with-expected, r=…
jonas-schievink Jan 25, 2021
975c4bc
Rollup merge of #80876 - ojeda:option-result-unwrap_unchecked, r=m-ou-se
jonas-schievink Jan 25, 2021
34abe17
Rollup merge of #80900 - camelid:readpointerasbytes-ice, r=oli-obk
jonas-schievink Jan 25, 2021
79ddb67
Rollup merge of #81158 - 1000teslas:issue-80313-fix, r=Aaron1011
jonas-schievink Jan 25, 2021
3210a25
Rollup merge of #81176 - camsteffen:qpath-res, r=oli-obk
jonas-schievink Jan 25, 2021
c2b8cd7
Rollup merge of #81195 - estebank:suggest-bound-on-trait-with-params,…
jonas-schievink Jan 25, 2021
1cbd775
Rollup merge of #81277 - flip1995:from_diag_items, r=matthewjasper
jonas-schievink Jan 25, 2021
457b3da
Rollup merge of #81299 - GuillaumeGomez:fix-eslint-detected-bugs, r=N…
jonas-schievink Jan 25, 2021
06ef1bf
Rollup merge of #81327 - RalfJung:codegen-no-const-fail, r=oli-obk
jonas-schievink Jan 25, 2021
34ca9c5
Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obk
jonas-schievink Jan 25, 2021
f308d77
Rollup merge of #81369 - tgnottingham:codegen-to-llvm-ir-wall-time, r…
jonas-schievink Jan 25, 2021
ba8379b
Rollup merge of #81389 - ehuss:rustdoc-cmark-extensions, r=GuillaumeG…
jonas-schievink Jan 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/test/src/test_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn calc_result<'a>(
))
}
}
(&ShouldPanic::Yes, Ok(())) => {
(&ShouldPanic::Yes, Ok(())) | (&ShouldPanic::YesWithMessage(_), Ok(())) => {
TestResult::TrFailedMsg("test did not panic as expected".to_string())
}
_ if desc.allow_fail => TestResult::TrAllowedFail,
Expand Down
39 changes: 24 additions & 15 deletions library/test/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,30 @@ fn test_should_panic_non_string_message_type() {
#[test]
#[cfg(not(target_os = "emscripten"))]
fn test_should_panic_but_succeeds() {
fn f() {}
let desc = TestDescAndFn {
desc: TestDesc {
name: StaticTestName("whatever"),
ignore: false,
should_panic: ShouldPanic::Yes,
allow_fail: false,
test_type: TestType::Unknown,
},
testfn: DynTestFn(Box::new(f)),
};
let (tx, rx) = channel();
run_test(&TestOpts::new(), false, desc, RunStrategy::InProcess, tx, Concurrent::No);
let result = rx.recv().unwrap().result;
assert_eq!(result, TrFailedMsg("test did not panic as expected".to_string()));
let should_panic_variants = [ShouldPanic::Yes, ShouldPanic::YesWithMessage("error message")];

for &should_panic in should_panic_variants.iter() {
fn f() {}
let desc = TestDescAndFn {
desc: TestDesc {
name: StaticTestName("whatever"),
ignore: false,
should_panic,
allow_fail: false,
test_type: TestType::Unknown,
},
testfn: DynTestFn(Box::new(f)),
};
let (tx, rx) = channel();
run_test(&TestOpts::new(), false, desc, RunStrategy::InProcess, tx, Concurrent::No);
let result = rx.recv().unwrap().result;
assert_eq!(
result,
TrFailedMsg("test did not panic as expected".to_string()),
"should_panic == {:?}",
should_panic
);
}
}

fn report_time_test_template(report_time: bool) -> Option<TestExecTime> {
Expand Down