feat(files): add _randomLineFromFile_

This commit is contained in:
Nathaniel Landau
2023-08-29 11:57:22 -04:00
parent 64c8658c8e
commit 69c1b491bb
4 changed files with 175 additions and 135 deletions

View File

@@ -301,6 +301,13 @@ _testParseYAML_() {
assert_line --index 2 'line 3'
}
@test "_randomLineFromFile_" {
echo -e "line 1\nline 2\nline 3" > testfile.txt
run _randomLineFromFile_ "testfile.txt"
assert_output --regexp "^line [123]$"
}
@test "_sourceFile_ failure" {
run _sourceFile_ "someNonExistentFile"