aboutsummaryrefslogtreecommitdiff
path: root/tests/project-name/testscript
blob: 78d02c06751d1f8e323a51222b3820b1a5487118 (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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# file      : tests/project-name/testscript
# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

: string
{
  test.arguments += 'string'

  : valid
  :
  $* <<EOF >>EOF
    foo
    foo1
    Foo
    foo_bar
    foo+bar
    foo-bar
    foo.bar
    build2
    EOF

  $* <'a'   2>'length is less than two characters'           != 0: short
  $* <'nul' 2>'illegal name'                                 != 0: illegal-name
  $* <'1a'  2>'illegal first character (must be alphabetic)' != 0: illegal-first-char
  $* <'a!b' 2>'illegal character'                            != 0: illegal-char

  : illegal-last-char
  :
  $* <'a.' 2>'illegal last character (must be alphabetic, digit, or plus)' != 0
}

: base
:
{
  test.arguments += 'base'

  : no-ext
  :
  $* <<EOI >>EOO
    libbutl
    libbutl.bash
    a.b.c
    EOI
    libbutl
    libbutl
    a.b
    EOO

  : ext
  :
  {
    test.arguments += bash;

    $* <<EOI >>EOO
      libbutl
      libbutl.bash
      libbutl.python
      EOI
      libbutl
      libbutl
      libbutl.python
      EOO
  }
}

: extension
:
{
  test.arguments += 'extension';

  $* <<EOI >>EOO
    libbutl
    libbutl.bash
    a.b.c
    EOI

    bash
    c
    EOO
}

: variable
:
{
  test.arguments += 'variable';

  $* <<EOI >>EOO
    foo-bar
    libc++
    libbutl.bash
    EOI
    foo_bar
    libc__
    libbutl_bash
    EOO
}