@@ -15,8 +15,6 @@ use std::{os, run, str, task};
15
15
use std:: io;
16
16
use std:: io:: fs;
17
17
use std:: io:: File ;
18
- use std:: io:: process;
19
- use std:: io:: process:: ProcessExit ;
20
18
use extra:: arc:: Arc ;
21
19
use extra:: arc:: RWArc ;
22
20
use extra:: tempfile:: TempDir ;
@@ -294,7 +292,7 @@ fn command_line_test_with_env(args: &[~str], cwd: &Path, env: Option<~[(~str, ~s
294
292
output. status) ;
295
293
if !output. status . success ( ) {
296
294
debug ! ( "Command {} {:?} failed with exit code {:?}; its output was --- {} ---" ,
297
- cmd, args, output. status,
295
+ cmd, args, output. status,
298
296
str :: from_utf8( output. output) + str :: from_utf8( output. error) ) ;
299
297
Fail ( output)
300
298
}
@@ -615,7 +613,6 @@ fn test_install_valid() {
615
613
}
616
614
617
615
#[ test]
618
- #[ ignore]
619
616
fn test_install_invalid ( ) {
620
617
let sysroot = test_sysroot ( ) ;
621
618
let pkgid = fake_pkg ( ) ;
@@ -631,8 +628,11 @@ fn test_install_invalid() {
631
628
pkgid. clone ( ) ) ;
632
629
ctxt. install ( pkg_src, & WhatToBuild :: new ( MaybeCustom , Everything ) ) ;
633
630
} ;
634
- assert ! ( result. unwrap_err( )
635
- . to_str( ) . contains( "supplied path for package dir does not exist" ) ) ;
631
+ let x = result. unwrap_err ( ) ;
632
+ assert ! ( x. is:: <~str >( ) ) ;
633
+ let error_string = * x. move :: < ~str > ( ) . unwrap ( ) ;
634
+ debug ! ( "result error = {}" , error_string) ;
635
+ assert ! ( error_string. contains( "supplied path for package dir does not exist" ) ) ;
636
636
}
637
637
638
638
#[ test]
@@ -663,7 +663,6 @@ fn test_install_valid_external() {
663
663
}
664
664
665
665
#[ test]
666
- #[ ignore( reason = "9994" ) ]
667
666
fn test_install_invalid_external ( ) {
668
667
let cwd = os:: getcwd ( ) ;
669
668
command_line_test_expect_fail ( [ ~"install", ~"foo"] ,
@@ -2442,6 +2441,21 @@ fn correct_error_dependency() {
2442
2441
}
2443
2442
}
2444
2443
2444
+ #[test]
2445
+ fn test_bad_package_id_url() {
2446
+ use str::{is_utf8, from_utf8};
2447
+
2448
+ match command_line_test_partial([~" install", ~" git: //github.com/mozilla/servo.git"],
2449
+ & os:: getcwd( ) ) {
2450
+ Fail ( ProcessOutput { error: _, output: output, _} ) => {
2451
+ assert!( is_utf8( output) ) ;
2452
+ assert!( from_utf8( output) . contains( "rustpkg operates on package IDs; did you mean to \
2453
+ write `github.com/mozilla/servo` instead") ) ;
2454
+ }
2455
+ Success ( * ) => fail!( "test_bad_package_id_url: succeeded but should have failed" )
2456
+ }
2457
+ }
2458
+
2445
2459
/// Returns true if p exists and is executable
2446
2460
fn is_executable( p: & Path ) -> bool {
2447
2461
p. exists( ) && p. stat( ) . perm & io:: UserExecute == io:: UserExecute
0 commit comments