<commit_before>#!/bin/sh

setUp() {
  . '../dist/bin/libnapalm'

  NAPALM_PROGRAMS_DIR=`mktemp -d`
  pd=$NAPALM_PROGRAMS_DIR # alias to reduce character count
}

tearDown() {
  rm -rf $pd
}

testShowProgramWithNameAndVersionNotInstalled() {
  local msg=`show_program_with_name_and_version foo 1.3`
  assertEquals 'Not installed: foo 1.3' "$msg"
}

testShowProgramWithNameAndVersionInstalledButNotActive() {
  local prog=$pd/foo-1.3
  mkdir -p $prog

  local msg=`show_program_with_name_and_version foo 1.3`
  assertEquals "   $prog" "$msg"
}

testShowProgramWithNameAndVersionInstalledButNotActive2() {
  local prog=$pd/foo-1.3
  mkdir -p $prog
  ln -s /tmp $pd/foo

  local msg=`show_program_with_name_and_version foo 1.3`
  assertEquals "   $prog" "$msg"
}

testShowProgramWithNameAndVersionInstalledAndActive() {
  local prog=$pd/foo-1.3
  mkdir -p $prog
  ln -s ${prog} $pd/foo

  local msg=`show_program_with_name_and_version foo 1.3`
  assertEquals " * $prog" "$msg"
}


testShowProgramWithNameNone() {
  local msg=`show_program_with_name foo`
  assertEquals "Not installed: foo" "$msg"<commit_msg>Improve test name.<commit_after>#!/bin/sh

setUp() {
  . '../dist/bin/libnapalm'

  NAPALM_PROGRAMS_DIR=`mktemp -d`
  pd=$NAPALM_PROGRAMS_DIR # alias to reduce character count
}

tearDown() {
  rm -rf $pd
}

testShowProgramWithNameAndVersionNotInstalled() {
  local msg=`show_program_with_name_and_version foo 1.3`
  assertEquals 'Not installed: foo 1.3' "$msg"
}

testShowProgramWithNameAndVersionInstalledButNotActive() {
  local prog=$pd/foo-1.3
  mkdir -p $prog

  local msg=`show_program_with_name_and_version foo 1.3`
  assertEquals "   $prog" "$msg"
}

testShowProgramWithNameAndVersionInstalledButNotActiveLinkPointsToSomethingElse() {
  local prog=$pd/foo-1.3
  mkdir -p $prog
  ln -s /tmp $pd/foo

  local msg=`show_program_with_name_and_version foo 1.3`
  assertEquals "   $prog" "$msg"
}

testShowProgramWithNameAndVersionInstalledAndActive() {
  local prog=$pd/foo-1.3
  mkdir -p $prog
  ln -s ${prog} $pd/foo

  local msg=`show_program_with_name_and_version foo 1.3`
  assertEquals " * $prog" "$msg"
}


testShowProgramWithNameNone() {
  local msg=`show_program_with_name foo`
  assertEquals "Not installed: foo" "$msg"
{'fraction_non_alphanumeric': 0.11935628073312472, 'fraction_numerical': 0.014751899865891819, 'mean_word_length': 4.768041237113402, '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': '5610082', 'n_tokens_mistral': 894, 'n_tokens_neox': 813, 'n_words': 165}