{
"id": "fn-test-file_contents_length_equal",
"dataComponent": "test",
"heading": {
"title": "file_contents_length_equal",
"badges": [
"Testing",
"Assert"
]
},
"synopsis": "Fails the test if the specified file's length in characters is not exactly the given integer, or if the file cannot be read.",
"codeBlocks": [
"extend(\"test\")\n\n# Basic usage:\nfile_contents_length_equal(\"/tmp/report.txt\", 100)\n# => passes if /tmp/report.txt is exactly 100 characters.\n\n# If it's a different length or unreadable, the test fails.\n"
],
"notes": [
"Expects exactly 2 arguments: (filename, lengthInt).",
"Reads the file as text, measures its length in characters. If it doesn't match lengthInt, fails the test with an error message.",
"If the file cannot be opened, the test also fails."
]
}