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

load './test_helper/bats-support/load'
load './test_helper/bats-assert/load'
load './test_helper/bats-file/load'

load '../src/prolog_ast_to_prolog_code'

@test "prolog_ast_to_prolog_code converts ASTs representing prolog to prolog code" {
  skip "Not sure how the prolog_ast_to_prolog_code should work"
}<commit_msg>test for prolog_ast_to_prolog_code<commit_after>#! /usr/bin/env bats

load './test_helper/bats-support/load'
load './test_helper/bats-assert/load'
load './test_helper/bats-file/load'

load '../src/prolog_ast_to_prolog_code'

@test "prolog_ast_to_prolog_code converts a simple AST representing a prolog program to prolog code" {
  echo_prolog_ast() {
    echo '{
      "type": "program",
      "clauses": [
        {
          "type": "predicate",
          "name": "format",
          "arguments": [
            {
              "type": "string",
              "value": "~s~n"
            },
            {
              "type": "list",
              "contents": [
                {
                  "type": "string",
                  "value": "Woah"
                }
              ]
            }
          ]
        }
      ]
    }' | jq --compact-output '.'
  }

  test_prolog_ast_to_prolog_code() {
    echo_prolog_ast | prolog_ast_to_prolog_code
  }

  run test_prolog_ast_to_prolog_code

  assert_output 'format("~s~n", ["Woah"]).'
}
{'fraction_non_alphanumeric': 0.13486370157819225, 'fraction_numerical': 0.0, 'mean_word_length': 2.065934065934066, 'pattern_counts': {'":': 11, '<': 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': '7539947', 'n_tokens_mistral': 496, 'n_tokens_neox': 478, 'n_words': 85}