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

    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) ->


      it 'reads a normal file with unpacked files', ->
        p = path.join fixtures, 'asar', 'unpack.asar', 'a.txt'
        assert.equal fs.readFileSync(p).toString().trim(), 'a'

    describe 'fs.readFile', ->
      it 'reads a normal file', (done) ->
        p = path.join fixtures, 'asar', 'a.asar', 'file1'
        fs.readFile p, (err, content) ->
          assert.equal err, null
          assert.equal String(content).trim(), 'file1'
          done()

      it 'reads from a empty file', (done) ->
