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

. ${BUILDPACK_TEST_RUNNER_HOME}/lib/test_utils.sh

testOverlayDir() {
  mkdir -p ${BUILD_DIR}/.jdk/jre/bin
  touch ${BUILD_DIR}/.jdk/jre/bin/java 
  mkdir -p ${BUILD_DIR}/.jdk-overlay/jre/lib/security
  mkdir -p ${BUILD_DIR}/.jdk-overlay/jre/bin
  touch ${BUILD_DIR}/.jdk-overlay/jre/lib/security/policy.jar

  compile

  assertTrue "Files in .jdk-overlay should be copied to .jdk." "[ -f ${BUILD_DIR}/.jdk/jre/lib/security/policy.jar ]"
  assertTrue "Files in .jdk should not be overwritten." "[ -f ${BUILD_DIR}/.jdk/jre/bin/java ]"
}

testWindowsFileCopy() {
  mkdir -p ${BUILD_DIR}/bin
  touch ${BUILD_DIR}/bin/java
  mkdir -p ${BUILD_DIR}/windows/bin
  mkdir -p ${BUILD_DIR}/.jdk-overlay/jre/bin
  touch ${BUILD_DIR}/windows/scripts/policy.jar
  mkdir -p ${BUILD_DIR}/template
  echo "existing" > ${BUILD_DIR}/template/runner
  mkdir -p ${BUILD_DIR}/windows/template
  echo "overridden" > ${BUILD_DIR}/windows/template/runner

  compile

  assertTrue "Files in  windows should be copied to .jdk." "[ -f ${BUILD_DIR}/windows/scripts/policy.jar ]"
  assertTrue "Existing file should not be deleted." "[ -f ${BUILD_DIR}/bin/java ]"
  local content="$(cat ${BUILD_DIR}/template/runner)"
  assertEquals "Existing files should be overridden." "overridden" "$content"
}
<commit_msg>Added some more assertions to tests.<commit_after>#!/usr/bin/env bash

. ${BUILDPACK_TEST_RUNNER_HOME}/lib/test_utils.sh

testOverlayDir() {
  mkdir -p ${BUILD_DIR}/.jdk/jre/bin
  touch ${BUILD_DIR}/.jdk/jre/bin/java 
  mkdir -p ${BUILD_DIR}/.jdk-overlay/jre/lib/security
  mkdir -p ${BUILD_DIR}/.jdk-overlay/jre/bin
  touch ${BUILD_DIR}/.jdk-overlay/jre/lib/security/policy.jar

  compile

  assertCapturedSuccess
  assertTrue "Files in .jdk-overlay should be copied to .jdk." "[ -f ${BUILD_DIR}/.jdk/jre/lib/security/policy.jar ]"
  assertTrue "Files in .jdk should not be overwritten." "[ -f ${BUILD_DIR}/.jdk/jre/bin/java ]"
}

testWindowsFileCopy() {
  mkdir -p ${BUILD_DIR}/bin
  touch ${BUILD_DIR}/bin/java
  mkdir -p ${BUILD_DIR}/windows/bin
  mkdir -p ${BUILD_DIR}/.jdk-overlay/jre/bin
  touch ${BUILD_DIR}/windows/scripts/policy.jar
  mkdir -p ${BUILD_DIR}/template
  echo "existing" > ${BUILD_DIR}/template/runner
  mkdir -p ${BUILD_DIR}/windows/template
  echo "overridden" > ${BUILD_DIR}/windows/template/runner

  compile

  assertCapturedSuccess
  assertTrue "Files in  windows should be copied to .jdk." "[ -f ${BUILD_DIR}/windows/scripts/policy.jar ]"
  assertTrue "Existing file should not be deleted." "[ -f ${BUILD_DIR}/bin/java ]"
  assertFileContains "Existing files should be overridden." "overridden" "${BUILD_DIR}/template/runner"
}

{'fraction_non_alphanumeric': 0.15862326973438085, 'fraction_numerical': 0.0, 'mean_word_length': 3.9888059701492535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3059065', 'n_tokens_mistral': 977, 'n_tokens_neox': 944, 'n_words': 198}