aboutsummaryrefslogtreecommitdiff
path: root/tests/git-pre-commit-copyright-check.testscript
blob: f8e51f58ba7b0fc2f163838ccd7e95e7dfe3afec (plain)
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
# file      : tests/git-pre-commit-copyright-check.testscript
# license   : MIT; see accompanying LICENSE file

.include git-common.testscript git-pre-commit-common.testscript

: basic
:
{
  $clone_prj;

  cat <<EOI >=prj/LICENSE;
    Copyright (c) 2014-2019 the build2 authors.
    EOI
  $ga .;

  $gc 2>>EOE;
    WARNING: last copyright year in 'LICENSE' is 2019
    EOE

  date +"%Y" | set year;
  cat <<"EOI" >=prj/LICENSE;
    Copyright (c) 2014-$year the build2 authors.
    EOI
  $gc
}