From 66455ad2d34c46650a798738c53bb550d250ab04 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 22 Aug 2009 11:31:35 +0200 Subject: Document rules of the language covered by each test --- tests/parser/makefile | 2 +- tests/parser/test-000.cli | 2 ++ tests/parser/test-001.cli | 2 ++ tests/parser/test-002.cli | 2 ++ tests/parser/test-003.cli | 18 ++++++---------- tests/parser/test-004.cli | 11 +++++----- tests/parser/test-005.cli | 55 ++++++++++++++++++++++++++++++++++++++++++++--- tests/parser/test-006.cli | 51 ------------------------------------------- tests/parser/test-006.std | 0 9 files changed, 72 insertions(+), 71 deletions(-) delete mode 100644 tests/parser/test-006.cli delete mode 100644 tests/parser/test-006.std (limited to 'tests') 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 ; 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 ; 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 -o3; + foo::bar -o4; + ::foo::bar -o5; + ::foo::baz -o6; + ::foo::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 -o3; - foo::bar -o4; - ::foo::bar -o5; - ::foo::baz -o6; - ::foo::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 -- cgit v1.1