<commit_before>// TODO need to find a better way to test the 32bit/64bit specific scenarios

var index = require('../index')
var should = require('should')

describe('regedit', function () {
	var baseKey = 'HKCU\\software\\ironSource\\regedit\\issues-test\\'
	var key

	// this test fails with a timeout because putValue callback is never invoked
	it('putValue with empty string for value fails silently #8', function (done) {
	
		index.createKey(key, function (err) {
			if (err) return done(err)

			var values = {}

			values[key] = { 'valName': { value: '', type: 'REG_SZ' }}

			index.putValue(values, function (err) {
				if (err) return done(err)

				index.list(key, function(err, results) {
					if (err) return done(err)

					results.should.have.property(key)
					.which.have.property('values')
					.which.have.property('valName')
					.which.have.property('value', '')

					done()
				})
			})
		})
	
	})

	it('can putValue REG_DWORD > 0x7fffffff #21', function (done) {
		index.createKey(key, function (err) {
			if (err) return done(err)

			var values = {}

			values[key] = { 'valName': { value: 0x80000000, type: 'REG_DWORD' }}

			index.putValue(values, function (err) {
				if (err) return done(err)

				index.list(key, function (err, results) {
					if (err) return done(err)

					results.should.have.property(key)
					.which.have.property('values')
					.which.have.property('valName')
					.which.have.property('value', 0x80000000)

					done()
				})
			})
		})
	})

	beforeEach(function () {<commit_msg>#21 - added tests for REG_QWORD case<commit_after>// TODO need to find a better way to test the 32bit/64bit specific scenarios

var index = require('../index')
var should = require('should')

describe('regedit', function () {
	var baseKey = 'HKCU\\software\\ironSource\\regedit\\issues-test\\'
	var key

	// this test fails with a timeout because putValue callback is never invoked
	it('putValue with empty string for value fails silently #8', function (done) {
	
		index.createKey(key, function (err) {
			if (err) return done(err)

			var values = {}

			values[key] = { 'valName': { value: '', type: 'REG_SZ' }}

			index.putValue(values, function (err) {
				if (err) return done(err)

				index.list(key, function(err, results) {
					if (err) return done(err)

					results.should.have.property(key)
					.which.have.property('values')
					.which.have.property('valName')
					.which.have.property('value', '')

					done()
				})
			})
		})
	
	})

	it('can putValue REG_DWORD > 0x7fffffff #21', function (done) {
		index.createKey(key, function (err) {
			if (err) return done(err)

			var values = {}

			values[key] = { 'valName': { value: 0x80000000, type: 'REG_DWORD' }}

			index.putValue(values, function (err) {
				if (err) return done(err)

				index.list(key, function (err, results) {
					if (err) return done(err)

					results.should.have.property(key)
					.which.have.property('values')
					.which.have.property('valName')
					.which.have.property('value', 0x80000000)

					done()
				})
			})
		})
	})

	it('can putValue REG_QWORD < 9007199254740993 #21', function (done) {
		index.createKey(key, function (err) {
			if (err) return done(err)

			var values = {}

			values[key] = { 'valName': { value: 9007199254740993, type: 'REG_QWORD' }}

			index.putValue(values, function (err) {
				if (err) return done(err)

				index.list(key, function (err, results) {
					if (err) return done(err)

					results.should.have.property(key)
					.which.have.property('values')
					.which.have.property('valName')
					.which.have.property('value', 9007199254740992)

					done()
				})

			})
		})
	})

	beforeEach(function () {
{'fraction_non_alphanumeric': 0.15612272603855554, 'fraction_numerical': 0.028780885147977192, 'mean_word_length': 3.17687074829932, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, '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': '3906505', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1219, 'n_words': 302}