<commit_before>var fs = require('fs')
var path = require('path')
var testutil = require('testutil')
var fse = require('../')


var terst = require('terst')

var TEST_DIR = ''

describe('fs-extra', function () {
  beforeEach(function() {
    TEST_DIR = testutil.createTestDir('fs-extra')
  })

  afterEach(function(done) {
    fse.remove(TEST_DIR, done)
  })

  describe('+ createFile', function() {
    describe('> when the file and directory does not exist', function() {
      it('should create the file', function(done) {
        var file = path.join(TEST_DIR, Math.random() + 't-ne', Math.random() + '.txt')
        F (fs.existsSync(file))
        fse.createFile(file, function(err) {
          F (err)
          T (fs.existsSync(file))
          done()
        })
      })
    })

    describe('> when the file does exist', function() {
      it('should not modify the file', function(done) {
        var file = path.join(TEST_DIR, Math.random() + 't-e', Math.random() + '.txt')
        fse.mkdirsSync(path.dirname(file))
        fs.writeFileSync(file, 'hello world')
        fse.createFile(file, function(err) {
          F (err)
          T (fs.readFileSync(file, 'utf8') === 'hello world')
          done()
        })
      })
    })
  })

  describe('+ createFileSync', function() {
    describe('> when the file and directory does not exist', function() {
      it('should create the file', function() {
        var file = path.join(TEST_DIR, Math.random() + 'ts-ne', Math.random() + '.txt')
        F (fs.existsSync(file))
        fse.createFileSync(file)
        T (fs.existsSync(file))
      })
    })

    describe('> when the file does exist', function() {
      it('should not modify the file', function() {
        var file = path.join(TEST_DIR, Math.random() + 'ts-e', Math.random() + '.txt')
        fse.mkdirsSync(path.dirname(file))
        fs.writeFileSync(file, 'hello world')
        fse.createFileSync(file)
        T (fs.readFileSync(file, 'utf8') === 'hello world')
      })
    })
  })
})<commit_msg>test/create.test: removed terst for assert<commit_after>var assert = require('assert')
var fs = require('fs')
var path = require('path')
var testutil = require('testutil')
var fse = require('../')

var TEST_DIR = ''

describe('fs-extra', function () {
  beforeEach(function() {
    TEST_DIR = testutil.createTestDir('fs-extra')
  })

  afterEach(function(done) {
    fse.remove(TEST_DIR, done)
  })

  describe('+ createFile', function() {
    describe('> when the file and directory does not exist', function() {
      it('should create the file', function(done) {
        var file = path.join(TEST_DIR, Math.random() + 't-ne', Math.random() + '.txt')
        assert(!fs.existsSync(file))
        fse.createFile(file, function(err) {
          assert.ifError(err)
          assert(fs.existsSync(file))
          done()
        })
      })
    })

    describe('> when the file does exist', function() {
      it('should not modify the file', function(done) {
        var file = path.join(TEST_DIR, Math.random() + 't-e', Math.random() + '.txt')
        fse.mkdirsSync(path.dirname(file))
        fs.writeFileSync(file, 'hello world')
        fse.createFile(file, function(err) {
          assert.ifError(err)
          assert.equal(fs.readFileSync(file, 'utf8'), 'hello world')
          done()
        })
      })
    })
  })

  describe('+ createFileSync', function() {
    describe('> when the file and directory does not exist', function() {
      it('should create the file', function() {
        var file = path.join(TEST_DIR, Math.random() + 'ts-ne', Math.random() + '.txt')
        assert(!fs.existsSync(file))
        fse.createFileSync(file)
        assert(fs.existsSync(file))
      })
    })

    describe('> when the file does exist', function() {
      it('should not modify the file', function() {
        var file = path.join(TEST_DIR, Math.random() + 'ts-e', Math.random() + '.txt')
        fse.mkdirsSync(path.dirname(file))
        fs.writeFileSync(file, 'hello world')
        fse.createFileSync(file)
        assert.equal(fs.readFileSync(file, 'utf8'), 'hello world')
      })
    })
  })
})
{'fraction_non_alphanumeric': 0.16686790630282541, 'fraction_numerical': 0.0009659502535619416, 'mean_word_length': 2.6687333923826393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3582506', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1301, 'n_words': 302}