1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/usr/bin/env bats
load helper
@test "head" {
run $HDFS head /_test/foo.txt
assert_success
assert_output "bar"
}
@test "head long" {
run $HDFS head /_test/mobydick.txt
assert_success
assert_output "$(head $ROOT_TEST_DIR/testdata/mobydick.txt)"
}
@test "head bytes" {
run $HDFS head -c 10 /_test/mobydick.txt
assert_success
assert_output "$(head -c 10 $ROOT_TEST_DIR/testdata/mobydick.txt)"
}
@test "head nonexistent" {
run $HDFS head /_test_cmd/nonexistent
assert_failure
assert_output <<OUT
open /_test_cmd/nonexistent: file does not exist
OUT
}
|