GoPLS Viewer

Home|gopls/copyright/copyright_test.go
1// Copyright 2020 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5//go:build go1.18
6// +build go1.18
7
8package copyright
9
10import (
11    "os"
12    "path/filepath"
13    "strings"
14    "testing"
15)
16
17func TestToolsCopyright(t *testing.T) {
18    cwderr := os.Getwd()
19    if err != nil {
20        t.Fatal(err)
21    }
22    tools := filepath.Dir(cwd)
23    if !strings.HasSuffix(filepath.Base(tools), "tools") {
24        t.Fatalf("current working directory is %s, expected tools"tools)
25    }
26    fileserr := checkCopyright(tools)
27    if err != nil {
28        t.Fatal(err)
29    }
30    if len(files) > 0 {
31        t.Errorf("The following files are missing copyright notices:\n%s"strings.Join(files"\n"))
32    }
33}
34
MembersX
os
testing
TestToolsCopyright
TestToolsCopyright.t
TestToolsCopyright.cwd
TestToolsCopyright.err
TestToolsCopyright.tools
TestToolsCopyright.files
Members
X