 
       it 'reads a linked file', ->
         p = path.join fixtures, 'asar', 'a.asar', 'link1'
-        assert.equal fs.readFileSync(p).toString(), 'file1\n'
+        assert.equal fs.readFileSync(p).toString().trim(), 'file1'
 
       it 'reads a file from linked directory', ->
         p = path.join fixtures, 'asar', 'a.asar', 'link2', 'file1'
-        assert.equal fs.readFileSync(p).toString(), 'file1\n'
+        assert.equal fs.readFileSync(p).toString().trim(), 'file1'
         p = path.join fixtures, 'asar', 'a.asar', 'link2', 'link2', 'file1'
-        assert.equal fs.readFileSync(p).toString(), 'file1\n'
+        assert.equal fs.readFileSync(p).toString().trim(), 'file1'
 
       it 'throws ENOENT error when can not find file', ->
         p = path.join fixtures, 'asar', 'a.asar', 'not-exist'

    it 'can request a file in package', (done) ->
      p = path.resolve fixtures, 'asar', 'a.asar', 'file1'
      $.get "file://#{p}", (data) ->
        assert.equal data, 'file1\n'
        done()

    it 'can request a file in package with unpacked files', (done) ->
      p = path.resolve fixtures, 'asar', 'unpack.asar', 'a.txt'
      $.get "file://#{p}", (data) ->
        assert.equal data, 'a\n'
        done()

    it 'can request a linked file in package', (done) ->
      p = path.resolve fixtures, 'asar', 'a.asar', 'link2', 'link1'
      $.get "file://#{p}", (data) ->
        assert.equal data, 'file1\n'
        done()

    it 'can request a file in filesystem', (done) ->
      p = path.resolve fixtures, 'asar', 'file'
      $.get "file://#{p}", (data) ->
        assert.equal data, 'file\n'
        done()

    it 'gets 404 when file is not found', (done) ->

          fd = fs.openSync p, 'r'
          buffer = new Buffer(6)
          fs.readSync fd, buffer, 0, 6, 0
          assert.equal String(buffer).trim(), 'file1'
          fs.closeSync fd

      it 'throws ENOENT error when can not find file', ->
