projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7222539
)
test: fix create-file test fixture
author
Alexis Campailla
<alexis@janeasystems.com>
Tue, 10 Dec 2013 13:25:27 +0000
(
05:25
-0800)
committer
Fedor Indutny
<fedor.indutny@gmail.com>
Tue, 10 Dec 2013 16:09:07 +0000
(20:09 +0400)
This was failing if the file didn't already exist.
Fixes unit tests on Windows:
* test\simple\test-http-curl-chunk-problem.js
* test\simple\test-pipe-file-to-http.js
test/fixtures/create-file.js
patch
|
blob
|
history
diff --git
a/test/fixtures/create-file.js
b/test/fixtures/create-file.js
index
c711da6
..
f2d89f3
100644
(file)
--- a/
test/fixtures/create-file.js
+++ b/
test/fixtures/create-file.js
@@
-24,4
+24,6
@@
var fs = require('fs');
var file_name = process.argv[2];
var file_size = parseInt(process.argv[3]);
-fs.truncateSync(file_name, file_size);
+var fd = fs.openSync(file_name, 'w');
+fs.ftruncateSync(fd, file_size);
+fs.closeSync(fd);