File: head.bats

package info (click to toggle)
golang-github-colinmarc-hdfs 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 3,760 kB
  • sloc: sh: 130; xml: 40; makefile: 31
file content (29 lines) | stat: -rw-r--r-- 577 bytes parent folder | download
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
}