@@ -1195,123 +1195,32 @@ pub enum InlinedItem {
11951195
11961196#[ cfg( test) ]
11971197mod test {
1198+ use extra;
1199+ use codemap:: * ;
11981200 use super :: * ;
11991201
12001202 fn is_freeze < T : Freeze > ( ) { }
12011203
12021204 // Assert that the AST remains Freeze (#10693).
1203- #[ test] fn ast_is_freeze ( ) {
1205+ #[ test]
1206+ fn ast_is_freeze ( ) {
12041207 is_freeze :: < Item > ( ) ;
12051208 }
1206- }
1207-
1208- /* hold off on tests ... they appear in a later merge.
1209- #[cfg(test)]
1210- mod test {
1211- use std::option::{None, Option, Some};
1212- use std::uint;
1213- use extra;
1214- use codemap::*;
1215- use super::*;
1216-
1217-
1218- #[test] fn xorpush_test () {
1219- let mut s = ~[];
1220- xorPush(&mut s,14);
1221- assert_eq!(s,~[14]);
1222- xorPush(&mut s,14);
1223- assert_eq!(s,~[]);
1224- xorPush(&mut s,14);
1225- assert_eq!(s,~[14]);
1226- xorPush(&mut s,15);
1227- assert_eq!(s,~[14,15]);
1228- xorPush (&mut s,16);
1229- assert_eq! (s,~[14,15,16]);
1230- xorPush (&mut s,16);
1231- assert_eq! (s,~[14,15]);
1232- xorPush (&mut s,15);
1233- assert_eq! (s,~[14]);
1234- }
1235-
1236- #[test] fn test_marksof () {
1237- let stopname = uints_to_name(&~[12,14,78]);
1238- assert_eq!(s,~[]);
1239- xorPush(&mut s,14);
1240- assert_eq!(s,~[14]);
1241- xorPush(&mut s,15);
1242- assert_eq!(s,~[14,15]);
1243- xorPush (&mut s,16);
1244- assert_eq! (s,~[14,15,16]);
1245- xorPush (&mut s,16);
1246- assert_eq! (s,~[14,15]);
1247- xorPush (&mut s,15);
1248- assert_eq! (s,~[14]);
1249- }
1250-
1251- #[test] fn test_marksof () {
1252- let stopname = uints_to_name(&~[12,14,78]);
1253- let name1 = uints_to_name(&~[4,9,7]);
1254- assert_eq!(marksof (MT,stopname),~[]);
1255- assert_eq! (marksof (Mark (4,@Mark(98,@MT)),stopname),~[4,98]);
1256- // does xoring work?
1257- assert_eq! (marksof (Mark (5, @Mark (5, @Mark (16,@MT))),stopname),
1258- ~[16]);
1259- // does nested xoring work?
1260- assert_eq! (marksof (Mark (5,
1261- @Mark (10,
1262- @Mark (10,
1263- @Mark (5,
1264- @Mark (16,@MT))))),
1265- stopname),
1266- ~[16]);
1267- // stop has no effect on marks
1268- assert_eq! (marksof (Mark (9, @Mark (14, @Mark (12, @MT))),stopname),
1269- ~[9,14,12]);
1270- // rename where stop doesn't match:
1271- assert_eq! (marksof (Mark (9, @Rename
1272- (name1,
1273- @Mark (4, @MT),
1274- uints_to_name(&~[100,101,102]),
1275- @Mark (14, @MT))),
1276- stopname),
1277- ~[9,14]);
1278- // rename where stop does match
1279- ;
1280- assert_eq! (marksof (Mark(9, @Rename (name1,
1281- @Mark (4, @MT),
1282- stopname,
1283- @Mark (14, @MT))),
1284- stopname),
1285- ~[9]);
1286- }
12871209
12881210 // are ASTs encodable?
1289- #[test] fn check_asts_encodable() {
1290- let bogus_span = span {lo:BytePos(10),
1291- hi:BytePos(20),
1292- expn_info:None};
1293- let e : crate =
1294- spanned{
1295- node: crate_ {
1296- module: Mod {view_items: ~[], items: ~[]} ,
1297- attrs: ~[] ,
1298- config: ~[]
1211+ #[ test]
1212+ fn check_asts_encodable ( ) {
1213+ let e = Crate {
1214+ module : Mod { view_items : ~ [ ] , items : ~ [ ] } ,
1215+ attrs : ~ [ ] ,
1216+ config : ~ [ ] ,
1217+ span : Span {
1218+ lo : BytePos ( 10 ) ,
1219+ hi : BytePos ( 20 ) ,
1220+ expn_info : None ,
12991221 } ,
1300- span: bogus_span };
1222+ } ;
13011223 // doesn't matter which encoder we use....
13021224 let _f = ( @e as @extra:: serialize:: Encodable < extra:: json:: Encoder > ) ;
13031225 }
1304-
1305-
13061226}
1307-
1308- */
1309- //
1310- // Local Variables:
1311- // mode: rust
1312- // fill-column: 78;
1313- // indent-tabs-mode: nil
1314- // c-basic-offset: 4
1315- // buffer-file-coding-system: utf-8-unix
1316- // End:
1317- //
0 commit comments