Add test for dot shorthands in constant initializers (#4093)

diff --git a/test/dot_shorthands_test.dart b/test/dot_shorthands_test.dart
index 5b236cb..76d3efb 100644
--- a/test/dot_shorthands_test.dart
+++ b/test/dot_shorthands_test.dart
@@ -114,4 +114,18 @@
 
     expect(m.hasAnnotations, true);
   }
+
+  void test_doc_dot_shorthand_const_init_success() async {
+    // Constant initializers are not linked so this test is just to make sure we
+    // don't crash.
+    var library = await bootPackageWithLibrary('''
+enum Color {
+  red, green
+}
+const Color favColor = .green;
+''');
+    var m = library.constants.named('favColor');
+
+    expect(m.hasDocumentation, false);
+  }
 }