<commit_before>require 'should'
options = require './options'

r = require('app-root-path').require
solrOpts = r 'lib/options/solr-options'
common = r 'test/common'


translations =
  empty: {}
  offset: start: 100
  limit: rows: 10
  sortArr: sort: 'name+desc,address+asc'

translations.sortObj = translations.sortArr
translations.combined =
  combined:
    start: 100
    rows: 10
    sort: translations.sortArr


testOptions = common.makeTester options, solrOpts.toSolr, translations

describe 'Solr options tests', () ->

  it 'should translate empty options', () ->
    testOptions 'empty'

  it 'should translate an offset option', () ->
    testOptions 'offset'

  it 'should translate a limit options', () ->
    testOptions 'limit'

  it 'should translate sort options given as array', () ->
    testOptions 'sortArr'

  it 'should translate sort options given as object', () ->
    testOptions 'sortObj'

  it 'should translate an offset options', () ->
    testOptions 'empty'
<commit_msg>fix bug in Solr options test<commit_after>require 'should'
options = require './options'

r = require('app-root-path').require
toSolr = r('lib/options').toSolr
common = r 'test/common'


translations =
  empty: {}
  offset: start: 100
  limit: rows: 10
  sortArr: sort: 'name+desc,address+asc'

translations.sortObj = translations.sortArr
translations.combined =
  start: 100
  rows: 10
  sort: translations.sortArr.sort


testOptions = common.makeTester options, toSolr, translations

describe 'Solr options tests', () ->

  it 'should translate empty options', () ->
    testOptions 'empty'

  it 'should translate an offset option', () ->
    testOptions 'offset'

  it 'should translate a limit options', () ->
    testOptions 'limit'

  it 'should translate sort options given as array', () ->
    testOptions 'sortArr'

  it 'should translate sort options given as object', () ->
    testOptions 'sortObj'

  it 'should translate combined options', () ->
    testOptions 'combined'

{'fraction_non_alphanumeric': 0.11971830985915492, 'fraction_numerical': 0.01006036217303823, 'mean_word_length': 3.8043478260869565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '2115152', 'n_tokens_mistral': 629, 'n_tokens_neox': 581, 'n_words': 190}