<commit_before>var painless = require('../../assertion/painless')
var test = painless.createGroup('Test string/case-camelize')
var t = painless.assert

var camelCase = require('../../../src/string/case-camelize')

test('should convert hyphenated text to camelCase', function () {
  var str = 'lorem-ipsum-dolor'
  t.eq(camelCase(str), 'loremIpsumDolor')
})

test('should convert spaces to camelCase', function () {
  var str = '  lorem ipsum  dolor  '
  t.eq(camelCase(str), 'loremIpsumDolor')
})

test('should convert underscores to camelCase', function () {
  var str = 'lorem_ipsum_dolor'
  t.eq(camelCase(str), 'loremIpsumDolor')
})

test('should remove non word', function () {
  var str = ' #$  lorem ipsum ^ &:  dolor ++ '
  t.eq(camelCase(str), 'loremIpsumDolor')
})

test('should replace accents', function () {
  var str = 'spéçïãl chârs'
  t.eq(camelCase(str), 'specialChars')
})

test('should do it all at once', function () {
  var str = '  %$ & lorem Ipsum @ dolor spéçïãl  ! chârs  )( )  '
  t.eq(camelCase(str), 'loremIpsumDolorSpecialChars')
})

test('should treat null as empty string', function () {
  t.is(camelCase(null), '')
})

test('should treat undefined as empty string', function () {
  t.is(camelCase(void 0), '')
})<commit_msg>update test string/case-camelize — add tests<commit_after>var painless = require('../../assertion/painless')
var test = painless.createGroup('Test string/case-camelize')
var t = painless.assert

var camelCase = require('../../../src/string/case-camelize')

test('should convert hyphenated text to camelCase', function () {
  var str = 'lorem-ipsum-dolor'
  t.eq(camelCase(str), 'loremIpsumDolor')
})

test('should convert spaces to camelCase', function () {
  var str = '  lorem ipsum  dolor  '
  t.eq(camelCase(str), 'loremIpsumDolor')
})

test('should convert underscores to camelCase', function () {
  var str = 'lorem_ipsum_dolor'
  t.eq(camelCase(str), 'loremIpsumDolor')
})

test('should remove non word', function () {
  var str = ' #$  lorem ipsum ^ &:  dolor ++ '
  t.eq(camelCase(str), 'loremIpsumDolor')
})

test('should replace accents', function () {
  var str = 'spéçïãl chârs'
  t.eq(camelCase(str), 'specialChars')
})

test('should do it all at once', function () {
  var str = '  %$ & lorem Ipsum @ dolor spéçïãl  ! chârs  )( )  '
  t.eq(camelCase(str), 'loremIpsumDolorSpecialChars')
})

test('should treat null as empty string', function () {
  t.is(camelCase(null), '')
})

test('should treat undefined as empty string', function () {
  t.is(camelCase(void 0), '')
})

test('underscore.string camelize tests', function(){
  t.eq(camelCase('the_camelize_string_method'), 'theCamelizeStringMethod')
  t.eq(camelCase('webkit-transform'), 'webkitTransform')
  t.eq(camelCase('-the-camelize-string-method'), 'theCamelizeStringMethod')
  t.eq(camelCase('_the_camelize_string_method'), 'theCamelizeStringMethod')
  t.eq(camelCase('The-camelize-string-method'), 'theCamelizeStringMethod')
  t.eq(camelCase('the camelize string method'), 'theCamelizeStringMethod')
  t.eq(camelCase(' the camelize  string method'), 'theCamelizeStringMethod')
  t.eq(camelCase('the camelize   string method'), 'theCamelizeStringMethod')
  t.eq(camelCase(' with   spaces'), 'withSpaces')
  t.eq(camelCase('_som eWeird---name-'), 'somEWeirdName')
  t.eq(camelCase(''), '', 'Camelize empty string returns empty string')
  t.eq(camelCase(null), '', 'Camelize null returns empty string')
  t.eq(camelCase(undefined), '', 'Camelize undefined returns empty string')
  t.eq(camelCase(123), '123')
})

{'fraction_non_alphanumeric': 0.16774922338322507, 'fraction_numerical': 0.0022592487997740753, 'mean_word_length': 4.903333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 4, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4131767', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1286, 'n_words': 271}