]> git.proxmox.com Git - rustc.git/blame - src/test/ui/custom_test_frameworks/full.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / custom_test_frameworks / full.rs
CommitLineData
b7449926
XL
1// run-pass
2// aux-build:example_runner.rs
3// compile-flags:--test
4
5#![feature(custom_test_frameworks)]
6#![test_runner(example_runner::runner)]
7extern crate example_runner;
8
9pub struct IsFoo(&'static str);
10
11impl example_runner::Testable for IsFoo {
12 fn name(&self) -> String {
13 self.0.to_string()
14 }
15
16 fn run(&self) -> Option<String> {
17 if self.0 != "foo" {
18 return Some(format!("{} != foo", self.0));
19 }
20 None
21 }
22}
23
24#[test_case]
25const TEST_1: IsFoo = IsFoo("hello");
26
27#[test_case]
28const TEST_2: IsFoo = IsFoo("foo");