1
Fork 0

Added Ascii type

This commit is contained in:
Marvin Löbel 2013-04-20 19:39:15 +02:00
parent 4357cbf2fa
commit 61ffee738d
4 changed files with 243 additions and 3 deletions

View file

@ -17,6 +17,12 @@
* some heavy-duty uses, try std::rope.
*/
// NOTE: Remove markers after snapshot
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
pub use self::ascii::{Ascii, AsciiCast, OwnedAsciiCast, ToStrAscii};
use at_vec;
use cast;
use char;
@ -34,6 +40,13 @@ use to_str::ToStr;
#[cfg(notest)] use cmp::{Eq, Ord, Equiv, TotalEq};
// NOTE: Remove markers after snapshot
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
#[path = "str/ascii.rs"]
mod ascii;
/*
Section: Creating a string
*/
@ -3347,7 +3360,7 @@ mod tests {
#[test]
fn test_shift_byte() {
let mut s = ~"ABC";
let b = raw::shift_byte(&mut s);
let b = unsafe{raw::shift_byte(&mut s)};
assert!((s == ~"BC"));
assert!((b == 65u8));
}
@ -3355,7 +3368,7 @@ mod tests {
#[test]
fn test_pop_byte() {
let mut s = ~"ABC";
let b = raw::pop_byte(&mut s);
let b = unsafe{raw::pop_byte(&mut s)};
assert!((s == ~"AB"));
assert!((b == 67u8));
}