File: cfssljson_test.go

package info (click to toggle)
golang-github-cloudflare-cfssl 1.6.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,220 kB
  • sloc: asm: 1,936; javascript: 652; makefile: 94; sql: 89; sh: 64; python: 11
file content (20 lines) | stat: -rw-r--r-- 299 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package main

import (
	"testing"
)

func TestReadFile(t *testing.T) {
	_, err := readFile("-")
	if err != nil {
		t.Fatal(err)
	}

	file, err := readFile("./testdata/test.txt")
	if err != nil {
		t.Fatal(err)
	}
	if string(file) != "This is a test file" {
		t.Fatal("File not read correctly")
	}
}