Created
March 30, 2012 16:34
-
-
Save laser/2252674 to your computer and use it in GitHub Desktop.
Problem running tests with @testling - "curl: (52) Empty reply from server"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////// | |
// u.js | |
function isEmail (email) { | |
var regEx = /^[a-zA-Z0-9.!#$%&'*+-\/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; | |
return regEx.test(email); | |
} | |
/////////// | |
// test.js | |
var test = require('testling'); | |
require.load("u.js"); | |
test("isEmail", function(t) { | |
var fx = isEmail; | |
t.equal(true, fx("[email protected]")); | |
t.equal(true, fx("eswensonhealey@example")); | |
t.equal(false, fx("eswensonhealey@@example.com")); | |
t.equal(false, fx("@example.com")); | |
t.equal(false, fx("eswensonhealey@")); | |
t.equal(false, fx("eswensonhealey")); | |
t.equal(false, fx("@")); | |
t.equal(false, fx("@.com")); | |
t.equal(false, fx("[email protected]")); | |
t.end(); | |
}); | |
////////////////// | |
// invoke Testling | |
machine:dir username$ tar -cf- u.js test.js | curl -u [email protected] -vsSNT- testling.com?browsers=firefox/3.6 | |
Enter host password for user '[email protected]': | |
* About to connect() to testling.com port 80 (#0) | |
* Trying 50.57.138.111... connected | |
* Connected to testling.com (50.57.138.111) port 80 (#0) | |
* Server auth using Basic with user '[email protected]' | |
> PUT /?browsers=firefox/3.6 HTTP/1.1 | |
> Authorization: Basic ZXJpbi5zd2Vuc29uLmhlYWxleUBnbWFpbC5jb206eG9vZ2xpZTk= | |
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 | |
> Host: testling.com | |
> Accept: */* | |
> Transfer-Encoding: chunked | |
> Expect: 100-continue | |
> | |
< HTTP/1.1 100 Continue | |
} [data not shown] | |
* Empty reply from server | |
* Connection #0 to host testling.com left intact | |
curl: (52) Empty reply from server | |
* Closing connection #0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment