summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-08-22 11:31:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-08-22 11:31:35 +0200
commit66455ad2d34c46650a798738c53bb550d250ab04 (patch)
treeb0d6204841aff9e976f17b7f3319216994bcdcdd /tests
parent3820d1b1bc4fdd3e5516f27807c3e58ee72e4c20 (diff)
Document rules of the language covered by each test
Diffstat (limited to 'tests')
-rw-r--r--tests/parser/makefile2
-rw-r--r--tests/parser/test-000.cli2
-rw-r--r--tests/parser/test-001.cli2
-rw-r--r--tests/parser/test-002.cli2
-rw-r--r--tests/parser/test-003.cli18
-rw-r--r--tests/parser/test-004.cli11
-rw-r--r--tests/parser/test-005.cli55
-rw-r--r--tests/parser/test-006.cli51
-rw-r--r--tests/parser/test-006.std0
9 files changed, 72 insertions, 71 deletions
diff --git a/tests/parser/makefile b/tests/parser/makefile
index 4642b6d..757c889 100644
--- a/tests/parser/makefile
+++ b/tests/parser/makefile
@@ -7,7 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make
cxx_tun := driver.cxx
-tests := 000 001 002 003 004 005 006
+tests := 000 001 002 003 004 005
#
#
diff --git a/tests/parser/test-000.cli b/tests/parser/test-000.cli
index 5951dc6..04c6576 100644
--- a/tests/parser/test-000.cli
+++ b/tests/parser/test-000.cli
@@ -1,3 +1,5 @@
+// def-unit
+//
include <string>;
namespace n {}
class c {};
diff --git a/tests/parser/test-001.cli b/tests/parser/test-001.cli
index a27e027..80233ff 100644
--- a/tests/parser/test-001.cli
+++ b/tests/parser/test-001.cli
@@ -1,2 +1,4 @@
+// include-decl-seq, include-decl
+//
include <string>;
include "types.hxx";
diff --git a/tests/parser/test-002.cli b/tests/parser/test-002.cli
index 2413b71..f8f368e 100644
--- a/tests/parser/test-002.cli
+++ b/tests/parser/test-002.cli
@@ -1,3 +1,5 @@
+// namespace-def, namespace-def-body
+//
namespace n1 {}
namespace n1
diff --git a/tests/parser/test-003.cli b/tests/parser/test-003.cli
index 2413b71..bfd8c72 100644
--- a/tests/parser/test-003.cli
+++ b/tests/parser/test-003.cli
@@ -1,13 +1,9 @@
-namespace n1 {}
-
-namespace n1
+// class-def
+//
+class c1
{
- namespace n2 {}
- class c {};
- namespace n2
- {
- namespace n3 {}
- }
-}
+};
-namespace n4 {}
+class c2
+{
+}; \ No newline at end of file
diff --git a/tests/parser/test-004.cli b/tests/parser/test-004.cli
index 5497dca..e913288 100644
--- a/tests/parser/test-004.cli
+++ b/tests/parser/test-004.cli
@@ -1,7 +1,8 @@
-class c1
+// option-def-seq
+//
+class c
{
+ bool -a;
+ int -b;
+ float -c;
};
-
-class c2
-{
-}; \ No newline at end of file
diff --git a/tests/parser/test-005.cli b/tests/parser/test-005.cli
index 84dc24f..9a43103 100644
--- a/tests/parser/test-005.cli
+++ b/tests/parser/test-005.cli
@@ -1,6 +1,55 @@
+// option-def, type-spec, fundamental-type-spec, option-name-seq,
+// option-name, initializer, initializer-expr
+//
class c
{
- bool -a;
- int -b;
- float -c;
+ bool --bool;
+ char --char;
+
+ int -i1;
+ unsigned int -i2;
+ int unsigned -i3;
+ long -i4;
+ long int -i5;
+ int long -i6;
+ unsigned long -i7;
+ long unsigned -i8;
+
+ unsigned long int -i9;
+ long unsigned int -i10;
+ int long unsigned -i11;
+ unsigned int long -i12;
+
+ short -i13;
+ unsigned short -i14;
+ short unsigned -i15;
+
+ char -i16;
+ signed char -i17;
+ char signed -i18;
+ unsigned char -i19;
+ char unsigned -i20;
+
+ double -d1;
+ long double -d2;
+ double long -d3;
+
+ foo -o1;
+ ::foo -o2;
+ ::foo<bar> -o3;
+ foo::bar -o4;
+ ::foo::bar -o5;
+ ::foo<bar>::baz -o6;
+ ::foo<bar>::baz< ::fox<2> > -o7;
+
+ bool -n1|--name1|/name1;
+ bool "-n2"|"--name2";
+
+ string -init1 = "string";
+ char -init2 = 'c';
+ int -init3 = -5;
+ bool -inti4 = true;
+ long -init5 = (2 * 4 - 5);
+ type -init6 = type::default_value;
+ type -init7 (abc, 2 - 1);
};
diff --git a/tests/parser/test-006.cli b/tests/parser/test-006.cli
deleted file mode 100644
index 7c70887..0000000
--- a/tests/parser/test-006.cli
+++ /dev/null
@@ -1,51 +0,0 @@
-class c
-{
- bool --bool;
- char --char;
-
- int -i1;
- unsigned int -i2;
- int unsigned -i3;
- long -i4;
- long int -i5;
- int long -i6;
- unsigned long -i7;
- long unsigned -i8;
-
- unsigned long int -i9;
- long unsigned int -i10;
- int long unsigned -i11;
- unsigned int long -i12;
-
- short -i13;
- unsigned short -i14;
- short unsigned -i15;
-
- char -i16;
- signed char -i17;
- char signed -i18;
- unsigned char -i19;
- char unsigned -i20;
-
- double -d1;
- long double -d2;
- double long -d3;
-
- foo -o1;
- ::foo -o2;
- ::foo<bar> -o3;
- foo::bar -o4;
- ::foo::bar -o5;
- ::foo<bar>::baz -o6;
- ::foo<bar>::baz< ::fox<2> > -o7;
-
- bool -n|--name|/name;
-
- string -init1 = "string";
- char -init2 = 'c';
- int -init3 = -5;
- bool -inti4 = true;
- long -init5 = (2 * 4 - 5);
- type -init6 = type::default_value;
- type -init7 (abc, 2 - 1);
-};
diff --git a/tests/parser/test-006.std b/tests/parser/test-006.std
deleted file mode 100644
index e69de29..0000000
--- a/tests/parser/test-006.std
+++ /dev/null