aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/error_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-10-01 09:43:28 +0200
committerBjörn Gustavsson <[email protected]>2015-01-12 11:40:23 +0100
commitcb6a006acbcec5aae7cf94f163f101fb6c9d439a (patch)
tree87f69ec423db79a378eb09d21decbe60ddff3a86 /lib/asn1/test/error_SUITE.erl
parent6003a7c9d4319eba8eff7bfb8e4a73d3d1d38786 (diff)
downloadotp-cb6a006acbcec5aae7cf94f163f101fb6c9d439a.tar.gz
otp-cb6a006acbcec5aae7cf94f163f101fb6c9d439a.tar.bz2
otp-cb6a006acbcec5aae7cf94f163f101fb6c9d439a.zip
Check CLASS names for validity
Class names must start with an uppercase letter and only contain uppercase letters, digits, or hyphens. The parser will not allow class names that don't start with an uppercase letter, so we don't have to check that.
Diffstat (limited to 'lib/asn1/test/error_SUITE.erl')
-rw-r--r--lib/asn1/test/error_SUITE.erl16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/asn1/test/error_SUITE.erl b/lib/asn1/test/error_SUITE.erl
index 1edd60f7c8..713f80cbee 100644
--- a/lib/asn1/test/error_SUITE.erl
+++ b/lib/asn1/test/error_SUITE.erl
@@ -19,7 +19,8 @@
-module(error_SUITE).
-export([suite/0,all/0,groups/0,
- already_defined/1,bitstrings/1,enumerated/1,
+ already_defined/1,bitstrings/1,
+ classes/1,enumerated/1,
imports/1,instance_of/1,integers/1,objects/1,
parameterization/1,values/1]).
@@ -34,6 +35,7 @@ groups() ->
[{p,parallel(),
[already_defined,
bitstrings,
+ classes,
enumerated,
imports,
instance_of,
@@ -94,6 +96,18 @@ bitstrings(Config) ->
]} = run(P, Config),
ok.
+classes(Config) ->
+ M = 'Classes',
+ P = {M,
+ <<"Classes DEFINITIONS AUTOMATIC TAGS ::= BEGIN\n"
+ " LowerCase ::= CLASS { &id INTEGER UNIQUE }\n"
+ "END\n">>},
+ {error,
+ [{structured_error,{M,2},asn1ct_check,{illegal_class_name,
+ 'LowerCase'}}
+ ]} = run(P, Config),
+ ok.
+
enumerated(Config) ->
M = 'Enumerated',
P = {M,