Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 31, 2013
1 parent fde542c commit 3b41667
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,25 @@
// vim: set softtabstop=3 shiftwidth=3:
var HttpDuplex = require ('./client.js')
var fs = require ('fs')
var input = fs . createReadStream (__filename)
var http = require ('http')
var assert = require ('assert')

var server = http . createServer (function (req, res) {
req . pipe (res)
server . close ()
})

server . listen (1337, function () {
var req = HttpDuplex ({ port: 1337, method: 'POST' })
input . pipe (req)
var result = ''
req . setEncoding ('utf8')
req . on ('data', function (c) {
result += c
})
req . on ('end', function () {
assert . equal (result, fs . readFileSync (__filename, 'utf8'))
console . log ('ok')
})
})

1 comment on commit 3b41667

@stagas
Copy link

@stagas stagas commented on 3b41667 Apr 1, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearly a reaction to being forced to use Google code style in your day job.

Please sign in to comment.