Fix lint issues in fs.lseek.spec.js

This commit is contained in:
David Humphrey 2018-07-27 10:43:51 -04:00
parent a8e373e4b9
commit 980d5d0917
1 changed files with 12 additions and 0 deletions

View File

@ -28,9 +28,11 @@ describe('fs.lseek', function() {
fs.stat('/myfile', function (error, result) {
expect(error).not.to.exist;
expect(result).to.exist;
fs.lstat('/myFileLink', function (error, result) {
expect(error).to.exist;
expect(result).not.to.exist;
fs.stat('/myOtherFileLink', function (error, result) {
if (error) throw error;
@ -57,6 +59,7 @@ describe('fs.lseek', function() {
fs.write(fd, buffer, 0, buffer.length, undefined, function(error, result) {
if(error) throw error;
expect(result).to.equal(buffer.length);
fs.lseek(fd, offset, 'SET', function(error, result) {
expect(error).not.to.exist;
@ -64,9 +67,11 @@ describe('fs.lseek', function() {
fs.write(fd, buffer, 0, buffer.length, undefined, function(error, result) {
if(error) throw error;
expect(result).to.equal(buffer.length);
fs.read(fd, result_buffer, 0, result_buffer.length, 0, function(error, result) {
if(error) throw error;
expect(result).to.equal(result_buffer.length);
fs.stat('/myfile', function(error, result) {
if(error) throw error;
@ -95,6 +100,7 @@ describe('fs.lseek', function() {
fs.write(fd, buffer, 0, buffer.length, undefined, function(error, result) {
if(error) throw error;
expect(result).to.equal(buffer.length);
fs.lseek(fd, offset, 'CUR', function(error, result) {
expect(error).not.to.exist;
@ -102,9 +108,11 @@ describe('fs.lseek', function() {
fs.write(fd, buffer, 0, buffer.length, undefined, function(error, result) {
if(error) throw error;
expect(result).to.equal(buffer.length);
fs.read(fd, result_buffer, 0, result_buffer.length, 0, function(error, result) {
if(error) throw error;
expect(result).to.equal(result_buffer.length);
fs.stat('/myfile', function(error, result) {
if(error) throw error;
@ -133,6 +141,7 @@ describe('fs.lseek', function() {
var fd1 = result;
fs.write(fd1, buffer, 0, buffer.length, undefined, function(error, result) {
if(error) throw error;
expect(result).to.equal(buffer.length);
fs.open('/myfile', 'w+', function(error, result) {
if(error) throw error;
@ -144,6 +153,7 @@ describe('fs.lseek', function() {
fs.write(fd2, buffer, 0, buffer.length, undefined, function(error, result) {
if(error) throw error;
expect(result).to.equal(buffer.length);
fs.stat('/myfile', function(error, result) {
if(error) throw error;
@ -153,6 +163,8 @@ describe('fs.lseek', function() {
result_buffer.fill(0);
fs.read(fd2, result_buffer, 0, result_buffer.length, 0, function(error, result) {
if(error) throw error;
expect(result).to.equal(result_buffer.length);
var expected = new Filer.Buffer([1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8]);
expect(result_buffer).to.deep.equal(expected);
done();