core: Shuffle around a #fmt test
This commit is contained in:
@@ -453,15 +453,6 @@ mod rt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
#[test]
|
|
||||||
fn test_percent() {
|
|
||||||
let s = #fmt["ab%%cd"];
|
|
||||||
assert(s == "ab%cd");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
// mode: rust;
|
// mode: rust;
|
||||||
// fill-column: 78;
|
// fill-column: 78;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ fn main() {
|
|||||||
part4();
|
part4();
|
||||||
part5();
|
part5();
|
||||||
part6();
|
part6();
|
||||||
|
percent();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn part1() {
|
fn part1() {
|
||||||
@@ -229,3 +230,8 @@ fn part6() {
|
|||||||
test(#fmt["%-+05d", 1], "+1 ");
|
test(#fmt["%-+05d", 1], "+1 ");
|
||||||
test(#fmt["%-+05d", -1], "-1 ");
|
test(#fmt["%-+05d", -1], "-1 ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn percent() {
|
||||||
|
let s = #fmt["ab%%cd"];
|
||||||
|
assert(s == "ab%cd");
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user