test: Remove @str
from the test suite
This commit is contained in:
parent
17b01041c2
commit
7a80fa647a
14 changed files with 1 additions and 66 deletions
|
@ -8,26 +8,15 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn wants_box(x: @str) { }
|
||||
fn wants_uniq(x: ~str) { }
|
||||
fn wants_slice(x: &str) { }
|
||||
|
||||
fn has_box(x: @str) {
|
||||
wants_box(x);
|
||||
wants_uniq(x); //~ ERROR str storage differs: expected `~` but found `@`
|
||||
wants_slice(x);
|
||||
}
|
||||
|
||||
fn has_uniq(x: ~str) {
|
||||
wants_box(x); //~ ERROR str storage differs: expected `@` but found `~`
|
||||
wants_uniq(x);
|
||||
wants_slice(x);
|
||||
}
|
||||
|
||||
fn has_slice(x: &str) {
|
||||
wants_box(x); //~ ERROR str storage differs: expected `@` but found `&`
|
||||
wants_uniq(x); //~ ERROR str storage differs: expected `~` but found `&`
|
||||
wants_slice(x);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ fn main() {
|
|||
@[1]; //~ ERROR type uses managed
|
||||
//~^ ERROR type uses managed
|
||||
fn f(_: @Clone) {} //~ ERROR type uses managed
|
||||
@""; //~ ERROR type uses managed
|
||||
//~^ ERROR type uses managed
|
||||
|
||||
~2; //~ ERROR type uses owned
|
||||
|
|
|
@ -34,7 +34,6 @@ pub fn main() {
|
|||
(&[1]).test_imm();
|
||||
("test").test_imm();
|
||||
(~"test").test_imm();
|
||||
(@"test").test_imm();
|
||||
(&"test").test_imm();
|
||||
|
||||
// FIXME: Other types of mutable vecs don't currently exist
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
#[feature(managed_boxes)];
|
||||
|
||||
pub fn main() {
|
||||
let (&x, &y, &z) = (&3, &'a', &@"No pets!");
|
||||
let (&x, &y) = (&3, &'a');
|
||||
assert_eq!(x, 3);
|
||||
assert_eq!(y, 'a');
|
||||
assert_eq!(z, @"No pets!");
|
||||
}
|
||||
|
|
|
@ -17,5 +17,4 @@ fn foo<T:Clone>(x: &T) -> T{
|
|||
pub fn main() {
|
||||
assert_eq!(foo(&3), 3);
|
||||
assert_eq!(foo(&'a'), 'a');
|
||||
assert_eq!(foo(&@"Dogs rule, cats drool"), @"Dogs rule, cats drool");
|
||||
}
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
pub fn main() {
|
||||
let _x : @str = @"hello";
|
||||
}
|
|
@ -58,7 +58,6 @@ pub fn main() {
|
|||
t!(format!("{}", 1.0f64), "1");
|
||||
t!(format!("{}", "a"), "a");
|
||||
t!(format!("{}", ~"a"), "a");
|
||||
t!(format!("{}", @"a"), "a");
|
||||
t!(format!("{}", false), "false");
|
||||
t!(format!("{}", 'a'), "a");
|
||||
|
||||
|
@ -73,7 +72,6 @@ pub fn main() {
|
|||
t!(format!("{:X}", 10u), "A");
|
||||
t!(format!("{:s}", "foo"), "foo");
|
||||
t!(format!("{:s}", ~"foo"), "foo");
|
||||
t!(format!("{:s}", @"foo"), "foo");
|
||||
t!(format!("{:p}", 0x1234 as *int), "0x1234");
|
||||
t!(format!("{:p}", 0x1234 as *mut int), "0x1234");
|
||||
t!(format!("{:d}", A), "aloha");
|
||||
|
|
|
@ -26,5 +26,4 @@ pub fn main()
|
|||
{
|
||||
assert!(compare("foo", "foo"));
|
||||
assert!(compare(~"foo", ~"foo"));
|
||||
assert!(compare(@"foo", @"foo"));
|
||||
}
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
use std::hashmap::HashMap;
|
||||
|
||||
pub fn main() {
|
||||
let mut x = HashMap::new();
|
||||
x.insert((@"abc", 0), 0);
|
||||
}
|
|
@ -43,19 +43,15 @@ fn g2(ref_1: &str, ref_2: &str) -> ~str {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
assert_eq!(f1(@"a"), ~"found a");
|
||||
assert_eq!(f1(~"b"), ~"found b");
|
||||
assert_eq!(f1(&"c"), ~"not found");
|
||||
assert_eq!(f1("d"), ~"not found");
|
||||
assert_eq!(f2(@"a"), ~"found a");
|
||||
assert_eq!(f2(~"b"), ~"found b");
|
||||
assert_eq!(f2(&"c"), ~"not found (c)");
|
||||
assert_eq!(f2("d"), ~"not found (d)");
|
||||
assert_eq!(g1(@"a", @"b"), ~"found a,b");
|
||||
assert_eq!(g1(~"b", ~"c"), ~"found b,c");
|
||||
assert_eq!(g1(&"c", &"d"), ~"not found");
|
||||
assert_eq!(g1("d", "e"), ~"not found");
|
||||
assert_eq!(g2(@"a", @"b"), ~"found a,b");
|
||||
assert_eq!(g2(~"b", ~"c"), ~"found b,c");
|
||||
assert_eq!(g2(&"c", &"d"), ~"not found (c, d)");
|
||||
assert_eq!(g2("d", "e"), ~"not found (d, e)");
|
||||
|
|
|
@ -79,7 +79,6 @@ pub fn main() {
|
|||
check_type!(~18: ~int);
|
||||
check_type!(@19: @int);
|
||||
check_type!(~"foo": ~str);
|
||||
check_type!(@"bar": @str);
|
||||
check_type!(~[20, 22]: ~[int]);
|
||||
check_type!(@[]: @[int]);
|
||||
check_type!(@[24, 26]: @[int]);
|
||||
|
|
|
@ -41,7 +41,6 @@ pub fn main() {
|
|||
check_type!(~int);
|
||||
check_type!(@int);
|
||||
check_type!(~str);
|
||||
check_type!(@str);
|
||||
check_type!(~[int]);
|
||||
check_type!(@[int]);
|
||||
check_type!(extern fn());
|
||||
|
|
|
@ -180,9 +180,6 @@ impl<V:TyVisitor + movable_ptr> TyVisitor for ptr_visit_adaptor<V> {
|
|||
}
|
||||
|
||||
fn visit_estr_box(&mut self) -> bool {
|
||||
self.align_to::<@str>();
|
||||
if ! self.inner().visit_estr_box() { return false; }
|
||||
self.bump_past::<@str>();
|
||||
true
|
||||
}
|
||||
|
||||
|
|
|
@ -63,11 +63,6 @@ pub fn main() {
|
|||
assert_eq!(map.find_equiv(&(~"cde")), Some(&c));
|
||||
assert_eq!(map.find_equiv(&(~"def")), Some(&d));
|
||||
|
||||
assert_eq!(map.find_equiv(&(@"abc")), Some(&a));
|
||||
assert_eq!(map.find_equiv(&(@"bcd")), Some(&b));
|
||||
assert_eq!(map.find_equiv(&(@"cde")), Some(&c));
|
||||
assert_eq!(map.find_equiv(&(@"def")), Some(&d));
|
||||
|
||||
assert_eq!(map.find_equiv(&SendStrStatic("abc")), Some(&a));
|
||||
assert_eq!(map.find_equiv(&SendStrStatic("bcd")), Some(&b));
|
||||
assert_eq!(map.find_equiv(&SendStrStatic("cde")), Some(&c));
|
||||
|
|
Loading…
Add table
Reference in a new issue