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

. $builddir/tests/test_common.sh

set -e -o pipefail

probecheck "yamlfilecontent" || return 255

oval_file="${srcdir}/test_probes_yamlfilecontent_content.xml"
result="results.xml"

[ -f $result ] && rm -f $result

$OSCAP oval eval --results $result $oval_file

[ -f $result ]

sd='/oval_results/results/system/oval_system_characteristics/system_data'

assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="foo" and text()="bar"]'
assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="boolean" and text()="true"]'
assert_exists 2 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and text()="<value>"]'

rm -f "$result"<commit_msg>tests: Fix minor problems<commit_after>#!/usr/bin/env bash

. $builddir/tests/test_common.sh

set -e -o pipefail

probecheck "yamlfilecontent" || exit 255

oval_file="${srcdir}/test_probes_yamlfilecontent_content.xml"
result="results.xml"

[ -f $result ] && rm -f $result

$OSCAP oval eval --results $result $oval_file

[ -f $result ]

sd='/oval_results/results/system/oval_system_characteristics/system_data'

assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="foo" and text()="bar"]'
assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="boolean" and text()="true"]'
assert_exists 2 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and text()="<value>"]'

rm -f "$result"
{'fraction_non_alphanumeric': 0.17533333333333334, 'fraction_numerical': 0.008, 'mean_word_length': 6.286407766990291, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '2653850', 'n_tokens_mistral': 567, 'n_tokens_neox': 546, 'n_words': 96}