<commit_before>#! /usr/bin/env bats

load ../environment

TESTS_DIR="$TEST_GO_ROOTDIR/tests"

setup() {
  test_filter
  mkdir -p "$TESTS_DIR"
  . "$_GO_USE_MODULES" 'complete'
}

teardown() {
  @go.remove_test_go_rootdir
}

@test "$SUITE: zero arguments" {
  local expected=('--trim' '--ignore')
  expected+=($(@go.compgen -d))

  run ./go complete 1 glob ''
  assert_success "${expected[@]}"
}

@test "$SUITE: first argument" {
  local expected=('--trim' '--ignore')

  run ./go complete 1 glob '-'
  assert_success "${expected[@]}"

  run ./go complete 1 glob '--t'
  assert_success '--trim '

  run ./go complete 1 glob '--i'<commit_msg>tests/glob/arg-comp: Source GO_USE_MODULES at top<commit_after>#! /usr/bin/env bats

load ../environment
. "$_GO_USE_MODULES" 'complete'

TESTS_DIR="$TEST_GO_ROOTDIR/tests"

setup() {
  test_filter
  mkdir -p "$TESTS_DIR"
}

teardown() {
  @go.remove_test_go_rootdir
}

@test "$SUITE: zero arguments" {
  local expected=('--trim' '--ignore')
  expected+=($(@go.compgen -d))

  run ./go complete 1 glob ''
  assert_success "${expected[@]}"
}

@test "$SUITE: first argument" {
  local expected=('--trim' '--ignore')

  run ./go complete 1 glob '-'
  assert_success "${expected[@]}"

  run ./go complete 1 glob '--t'
  assert_success '--trim '

  run ./go complete 1 glob '--i'
{'fraction_non_alphanumeric': 0.1887366818873668, 'fraction_numerical': 0.0060882800608828, 'mean_word_length': 3.5344827586206895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2244820', 'n_tokens_mistral': 508, 'n_tokens_neox': 488, 'n_words': 121}