             o.repeatedForeignEnum = [.foreignBar, .foreignBaz]
         }
 
+        assertTextFormatDecodeSucceeds("repeated_foreign_enum: [5, 6]\n") {(o: MessageTestType) in
+            o.repeatedForeignEnum == [.foreignBar, .foreignBaz]
+        }
+
+        assertTextFormatEncode("repeated_foreign_enum: [123, 321]\n") {(o: inout MessageTestType) in
+            o.repeatedForeignEnum = [.UNRECOGNIZED(123), .UNRECOGNIZED(321)]
+        }
+
         assertTextFormatDecodeFails("repeated_foreign_enum: FOREIGN_BAR\nrepeated_foreign_enum: a\n")
     }
 
     func testEncoding_repeatedImportEnum() {
         assertTextFormatEncode("repeated_import_enum: [IMPORT_BAR, IMPORT_BAZ]\n") {(o: inout MessageTestType) in
             o.repeatedImportEnum = [.importBar, .importBaz]
+        }
+
+        assertTextFormatDecodeSucceeds("repeated_import_enum: [8, 9]\n") {(o: MessageTestType) in
+            o.repeatedImportEnum == [.importBar, .importBaz]
+        }
+
+        assertTextFormatEncode("repeated_import_enum: [999, 888]\n") {(o: inout MessageTestType) in
+            o.repeatedImportEnum = [.UNRECOGNIZED(999), .UNRECOGNIZED(888)]
         }
 
         assertTextFormatDecodeFails("repeated_import_enum: IMPORT_BAR\nrepeated_import_enum: a\n")

        XCTAssertEqual("single_foreign_enum: FOREIGN_BAZ\n", a.textFormatString())

        assertTextFormatEncode("single_foreign_enum: FOREIGN_BAZ\n") {(o: inout MessageTestType) in o.singleForeignEnum = .foreignBaz }

        assertTextFormatDecodeFails("single_foreign_enum: a\n")
    }

        XCTAssertEqual("single_import_enum: IMPORT_BAZ\n", a.textFormatString())

        assertTextFormatEncode("single_import_enum: IMPORT_BAZ\n") {(o: inout MessageTestType) in o.singleImportEnum = .importBaz }
        assertTextFormatDecodeSucceeds("single_import_enum: 9\n") {(o: MessageTestType) in o.singleImportEnum == .importBaz }

        assertTextFormatEncode("single_import_enum: 66\n") {(o: inout MessageTestType) in o.singleImportEnum = .UNRECOGNIZED(66) }

        assertTextFormatDecodeFails("single_import_enum: a\n")
    }
