This file is indexed.

/usr/share/gocode/src/github.com/DHowett/go-plist/text_test.go is in golang-github-dhowett-go-plist-dev 0.0~git20160708.0.fec78c8-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package plist

import (
	"bytes"
	"io/ioutil"
	"testing"
)

func BenchmarkOpenStepGenerate(b *testing.B) {
	for i := 0; i < b.N; i++ {
		d := newTextPlistGenerator(ioutil.Discard, OpenStepFormat)
		d.generateDocument(plistValueTree)
	}
}

func BenchmarkOpenStepParse(b *testing.B) {
	buf := bytes.NewReader([]byte(plistValueTreeAsOpenStep))
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		b.StartTimer()
		d := newTextPlistParser(buf)
		d.parseDocument()
		b.StopTimer()
		buf.Seek(0, 0)
	}
}

func BenchmarkGNUStepParse(b *testing.B) {
	buf := bytes.NewReader([]byte(plistValueTreeAsGNUStep))
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		b.StartTimer()
		d := newTextPlistParser(buf)
		d.parseDocument()
		b.StopTimer()
		buf.Seek(0, 0)
	}
}

func TestTextCommentDecode(t *testing.T) {
	var testData = `{
		A=1 /* A is 1 because it is the first letter */;
		B=2; // B is 2 because comment-to-end-of-line.
		C=3;
		S = /not/a/comment/;
		S2 = /not*a/*comm*en/t;
	}`
	type D struct {
		A, B, C int
		S       string
		S2      string
	}
	actual := D{1, 2, 3, "/not/a/comment/", "/not*a/*comm*en/t"}
	var parsed D
	buf := bytes.NewReader([]byte(testData))
	decoder := NewDecoder(buf)
	err := decoder.Decode(&parsed)
	if err != nil {
		t.Error(err.Error())
	}

	if actual != parsed {
		t.Logf("Expected: %#v", actual)
		t.Logf("Received: %#v", parsed)
		t.Fail()
	}
}