Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: mojom/mojom_parser/parser/parser_test.go

Issue 1514173002: New Mojom parser: Don't allow enum variables to be assigned int values. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: working on stuff Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojom/mojom_parser/mojom/user_defined_types_test.go ('k') | mojom/mojom_parser/parser/resolution_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/parser/parser_test.go
diff --git a/mojom/mojom_parser/parser/parser_test.go b/mojom/mojom_parser/parser/parser_test.go
index d07f42688b656598dc9bd353ed3ab93898ddc2c0..1a7d028e56a3a87987f44831dfe545826cd2c5dc 100644
--- a/mojom/mojom_parser/parser/parser_test.go
+++ b/mojom/mojom_parser/parser/parser_test.go
@@ -711,34 +711,6 @@ func TestInvalidAssignmentDuringParsing(t *testing.T) {
endTestCase()
////////////////////////////////////////////////////////////
- // Test Case (Assign string to user-defined-type)
- ////////////////////////////////////////////////////////////
- startTestCase("")
- cases[testCaseNum].mojomContents = `
- struct Foo {
- Foo x = "hello";
- };
-
- `
- expectError("Illegal assignment")
- expectError("Field x of type Foo may not be assigned the value \"hello\" of type string.")
- endTestCase()
-
- ////////////////////////////////////////////////////////////
- // Test Case (Assign string to user-defined-type)
- ////////////////////////////////////////////////////////////
- startTestCase("")
- cases[testCaseNum].mojomContents = `
- struct Foo {
- Foo x = "hello";
- };
-
- `
- expectError("Illegal assignment")
- expectError("Field x of type Foo may not be assigned the value \"hello\" of type string.")
- endTestCase()
-
- ////////////////////////////////////////////////////////////
// Group 2: Assign to constant.
////////////////////////////////////////////////////////////
@@ -765,17 +737,6 @@ func TestInvalidAssignmentDuringParsing(t *testing.T) {
endTestCase()
////////////////////////////////////////////////////////////
- // Test Case (Assign boolean to user-defined type)
- ////////////////////////////////////////////////////////////
- startTestCase("")
- cases[testCaseNum].mojomContents = `
- const FooType Foo = true;
- `
- expectError("Illegal assignment")
- expectError("Constant Foo of type FooType may not be assigned the value true of type bool.")
- endTestCase()
-
- ////////////////////////////////////////////////////////////
// Execute all of the test cases.
////////////////////////////////////////////////////////////
for i, c := range cases {
« no previous file with comments | « mojom/mojom_parser/mojom/user_defined_types_test.go ('k') | mojom/mojom_parser/parser/resolution_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698