Add a unit test for module name enforcement

With https://r.android.com/3478084, blueprint will become more strict on
allowing special chars in module names.

Test: m nothing --no-skip-soong-tests
Change-Id: I89fd7631d6e12e5af25641ca953f9e5659a9728c
diff --git a/android/module_test.go b/android/module_test.go
index 6e6d449..3b81ded 100644
--- a/android/module_test.go
+++ b/android/module_test.go
@@ -1110,3 +1110,14 @@
 			"Module .+ and Vintf_fragment .+ are installed to different partitions.")).
 		RunTestWithBp(t, bp)
 }
+
+func TestInvalidModuleName(t *testing.T) {
+	bp := `
+		deps {
+			name: "fo o",
+		}
+	`
+	prepareForModuleTests.
+		ExtendWithErrorHandler(FixtureExpectsOneErrorPattern(`should use a valid name`)).
+		RunTestWithBp(t, bp)
+}