mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
Fix Option camel case in xfailed/ignored tests
This commit is contained in:
parent
3a5d2cdbf3
commit
edc94f5c23
@ -255,7 +255,7 @@ mod test {
|
||||
};
|
||||
|
||||
match recv_timeout(hl_loop, 10u, test_po) {
|
||||
some(val) => {
|
||||
Some(val) => {
|
||||
assert val == expected;
|
||||
successes += 1;
|
||||
}
|
||||
|
@ -15,9 +15,9 @@
|
||||
xfailed for now (see Issue #2354)
|
||||
*/
|
||||
fn foo() { //~ ERROR this open brace is not closed
|
||||
match some(x) {
|
||||
some(y) { fail; }
|
||||
none { fail; }
|
||||
match Some(x) {
|
||||
Some(y) { fail; }
|
||||
None { fail; }
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
|
@ -69,8 +69,8 @@ fn main() {
|
||||
let stmt = quote_stmt!(let x = 20;);
|
||||
check_pp(ext_cx, *stmt, pprust::print_stmt, ~"let x = 20;");
|
||||
|
||||
let pat = quote_pat!(some(_));
|
||||
check_pp(ext_cx, pat, pprust::print_refutable_pat, ~"some(_)");
|
||||
let pat = quote_pat!(Some(_));
|
||||
check_pp(ext_cx, pat, pprust::print_refutable_pat, ~"Some(_)");
|
||||
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,9 @@ fn dispose(+_x: arc::ARC<bool>) unsafe { }
|
||||
|
||||
fn main() {
|
||||
let p = arc::arc(true);
|
||||
let x = some(p);
|
||||
let x = Some(p);
|
||||
match move x {
|
||||
some(move z) => { dispose(z); },
|
||||
none => fail
|
||||
Some(move z) => { dispose(z); },
|
||||
None => fail
|
||||
}
|
||||
}
|
||||
|
@ -55,8 +55,8 @@ class cat : map<int, bool> {
|
||||
fn contains_key(&&k: int) -> bool { k <= self.meows }
|
||||
fn get(&&k:int) -> bool { k <= self.meows }
|
||||
fn [](&&k:int) -> bool { k <= self.meows }
|
||||
fn find(&&k:int) -> option<bool> { some(self.get(k)) }
|
||||
fn remove(&&k:int) -> option<bool> { self.meows -= k; some(true) }
|
||||
fn find(&&k:int) -> Option<bool> { Some(self.get(k)) }
|
||||
fn remove(&&k:int) -> Option<bool> { self.meows -= k; Some(true) }
|
||||
fn each(f: fn(&&int, &&bool) -> bool) {
|
||||
let mut n = int::abs(self.meows);
|
||||
while n > 0 {
|
||||
|
@ -23,7 +23,7 @@ trait noisy {
|
||||
}
|
||||
|
||||
trait scratchy {
|
||||
fn scratch() -> option<furniture>;
|
||||
fn scratch() -> Option<furniture>;
|
||||
}
|
||||
|
||||
trait bitey {
|
||||
@ -72,13 +72,13 @@ class cat : noisy, scratchy, bitey {
|
||||
|
||||
fn speak() -> int { self.meow() as int }
|
||||
fn meow_count() -> uint { *self.meows }
|
||||
fn scratch() -> option<furniture> {
|
||||
fn scratch() -> Option<furniture> {
|
||||
let all = ~[chair, couch, bed];
|
||||
log(error, self.scratched);
|
||||
let mut rslt = none;
|
||||
let mut rslt = None;
|
||||
for each(all) |thing| { if !self.scratched.contains(thing) {
|
||||
self.scratched.push(thing);
|
||||
return some(thing); }}
|
||||
return Some(thing); }}
|
||||
rslt
|
||||
}
|
||||
fn bite() -> body_part {
|
||||
|
@ -23,7 +23,7 @@ class keys<K: Copy, V: Copy, M: Copy map<K,V>>
|
||||
}
|
||||
|
||||
fn each(blk: fn(K) -> bool) { self.map.each(|k, _v| blk(k) ) }
|
||||
fn size_hint() -> option<uint> { some(self.map.size()) }
|
||||
fn size_hint() -> Option<uint> { Some(self.map.size()) }
|
||||
fn eachi(blk: fn(uint, K) -> bool) { iter::eachi(self, blk) }
|
||||
}
|
||||
|
||||
|
@ -9,16 +9,16 @@
|
||||
// except according to those terms.
|
||||
|
||||
// xfail-test
|
||||
enum pat { pat_ident(option<uint>) }
|
||||
enum pat { pat_ident(Option<uint>) }
|
||||
|
||||
fn f(pat: pat) -> bool { true }
|
||||
|
||||
fn num_bindings(pat: pat) -> uint {
|
||||
match pat {
|
||||
pat_ident(_) if f(pat) { 0 }
|
||||
pat_ident(none) { 1 }
|
||||
pat_ident(some(sub)) { sub }
|
||||
pat_ident(None) { 1 }
|
||||
pat_ident(Some(sub)) { sub }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
fn main() {}
|
||||
|
@ -15,14 +15,14 @@ struct cell<T> {
|
||||
}
|
||||
|
||||
struct cells<T> {
|
||||
vals: ~[option<cell<T>>];
|
||||
vals: ~[Option<cell<T>>];
|
||||
}
|
||||
|
||||
impl<T> &cells<T> {
|
||||
fn get(idx: uint) -> &self/T {
|
||||
match self.vals[idx] {
|
||||
some(ref v) => &v.value,
|
||||
none => fail
|
||||
Some(ref v) => &v.value,
|
||||
None => fail
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user