<commit_before>void test_owned (ValueArray array) {
	uint i = 0;

	foreach (Value item in array) {
		i++;
	}

	assert (i == 3);
}

void test_unowned (ValueArray array) {
	uint i = 0;

	foreach (unowned Value item in array) {
		i++;
	}

	assert (i == 3);
}

void test_foreach_gvaluearray () {
	Value value;
	ValueArray array = new ValueArray (3);

	value = 1;
	array.append (value);
	value = 2.0;
	array.append (value);
	value = "three";
	array.append (value);

	test_owned (array);
	test_unowned (array);
}

void test_foreach_multidim_array () {
	int[,] foo = { { 1, 2 }, { 3, 4 }, { 5, 6 } };
	string result = "";
	foreach (var i in foo) {
		result += i.to_string ();
	}
	assert (result == "123456");
}

const int[] FOO = { 1, 2, 3, 4, 5, 6 };

void test_foreach_const_array () {
	string result = "";
	foreach (var i in FOO) {
		result += i.to_string ();
	}
	assert (result == "123456");
}

void test_foreach_slice_array () {
	int[] foo = { 1, 2, 3, 4, 5, 6 };
	string result = "";
	foreach (var i in foo[1:foo.length - 1]) {
		result += i.to_string ();
	}
	assert (result == "2345");
}

void main () {
	test_foreach_gvaluearray ();
	test_foreach_const_array ();
	test_foreach_multidim_array ();
	test_foreach_slice_array ();
}
<commit_msg>tests: Extend "array foreach" test to increase coverage<commit_after>void test_owned (ValueArray array) {
	uint i = 0;

	foreach (Value item in array) {
		i++;
	}

	assert (i == 3);
}

void test_unowned (ValueArray array) {
	uint i = 0;

	foreach (unowned Value item in array) {
		i++;
	}

	assert (i == 3);
}

void test_foreach_gvaluearray () {
	Value value;
	ValueArray array = new ValueArray (3);

	value = 1;
	array.append (value);
	value = 2.0;
	array.append (value);
	value = "three";
	array.append (value);

	test_owned (array);
	test_unowned (array);
}

void test_foreach_multidim_array () {
	int[,] foo = { { 1, 2 }, { 3, 4 }, { 5, 6 } };
	string result = "";
	foreach (var i in foo) {
		result += i.to_string ();
	}
	assert (result == "123456");
}

const int[] FOO = { 1, 2, 3, 4, 5, 6 };
const int BAR[] = { 6, 5, 4, 3, 2, 1 };

void test_foreach_const_array () {
	string result = "";
	foreach (var i in FOO) {
		result += i.to_string ();
	}
	assert (result == "123456");

	string result2 = "";
	foreach (var i in BAR) {
		result2 += i.to_string ();
	}
	assert (result2 == "654321");
}

void test_foreach_slice_array () {
	int[] foo = { 1, 2, 3, 4, 5, 6 };
	string result = "";
	foreach (var i in foo[1:foo.length - 1]) {
		result += i.to_string ();
	}
	assert (result == "2345");
}

void main () {
	test_foreach_gvaluearray ();
	test_foreach_const_array ();
	test_foreach_multidim_array ();
	test_foreach_slice_array ();
}

{'fraction_non_alphanumeric': 0.17077727952167415, 'fraction_numerical': 0.03849028400597907, 'mean_word_length': 3.529610829103215, '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': '7127055', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1030, 'n_words': 292}