diff --git a/common/test/keyboards/invalid/README.md b/common/test/keyboards/invalid/README.md
index e68cea4081..a1a1b5e3ab 100644
--- a/common/test/keyboards/invalid/README.md
+++ b/common/test/keyboards/invalid/README.md
@@ -7,8 +7,6 @@ Most of these tests are copied from balochi_phonetic and contain alterations of
----
-
## Naming Convention of kmn-files for using with kmcompxtest()
CERR_404D_balochi_phonetic.kmn
@@ -25,8 +23,6 @@ The naming convention of the files is as follows:
( e.g. CERR_404D_balochi_phonetic.kmn should produce error 0x0000404D).
-
----
While running, kmcompxtest extracts those 4 characters from the Filename (e.g. 404D for CERR_404D_balochi_phonetic) and compares those to the actual error found.
@@ -41,119 +37,127 @@ While running, kmcompxtest extracts those 4 characters from the Filename (e.g. 4
* If more than 1 error is produced, only the error coded in the Filename will be detected
-
+
+
### Tests are available for the following CERR_:
- ( ) 00000800 CERR_LEXICAL_MODEL_MIN
- ( ) 000008FF CERR_LEXICAL_MODEL_MAX
- ( ) 00000000 CERR_None
- ( ) 00000001 CERR_EndOfFile
- ( ) 00008002 CERR_BadCallParams
- ( ) 00008004 CERR_CannotAllocateMemory
- ( ) 00008005 CERR_InfileNotExist
- ( ) 00008006 CERR_CannotCreateOutfile
- ( ) 00008007 CERR_UnableToWriteFully
- ( ) 00008008 CERR_CannotReadInfile
- ( ) 00008009 CERR_SomewhereIGotItWrong
- ( **x** ) 0000400A CERR_InvalidToken
- ( ) 0000400B CERR_InvalidBegin
- ( ) 0000400C CERR_InvalidName
- ( **x** ) 0000400D CERR_InvalidVersion
- ( **x** ) 0000400E CERR_InvalidLanguageLine
- ( ) 0000400F CERR_LayoutButNoLanguage
- ( ) 00004010 CERR_InvalidLayoutLine
- ( ) 00004011 CERR_NoVersionLine
- ( ) 00004012 CERR_InvalidGroupLine
- ( **x** ) 00004013 CERR_InvalidStoreLine
- ( ) 00004014 CERR_InvalidCodeInKeyPartOfRule
- ( **x** ) 00004015 CERR_InvalidDeadkey
- ( **x** ) 00004016 CERR_InvalidValue
- ( **x** ) 00004017 CERR_ZeroLengthString
- ( ) 00004018 CERR_TooManyIndexToKeyRefs
- ( **x** ) 00004019 CERR_UnterminatedString
- ( ) 0000401A CERR_StringInVirtualKeySection
- ( ) 0000401B CERR_AnyInVirtualKeySection
- ( ) 0000401C CERR_InvalidAny
- ( **x** ) 0000401D CERR_StoreDoesNotExist
- ( ) 0000401E CERR_BeepInVirtualKeySection
- ( ) 0000401F CERR_IndexInVirtualKeySection
- ( ) 00004020 CERR_InvalidIndex
- ( ) 00004021 CERR_OutsInVirtualKeySection
- ( ) 00004022 CERR_InvalidOuts
- ( ) 00004024 CERR_ContextInVirtualKeySection
- ( ) 00004025 CERR_InvalidUse
- ( **x** ) 00004026 CERR_GroupDoesNotExist
- ( ) 00004027 CERR_VirtualKeyNotAllowedHere
- ( ) 00004028 CERR_InvalidSwitch
- ( **x** ) 00004029 CERR_NoTokensFound
- ( ) 0000402A CERR_InvalidLineContinuation
- ( **x** ) 0000402B CERR_LineTooLong
- ( ) 0000402C CERR_InvalidCopyright
- ( **x** ) 0000402D CERR_CodeInvalidInThisSection
- ( ) 0000402E CERR_InvalidMessage
- ( ) 0000402F CERR_InvalidLanguageName
- ( ) 00004030 CERR_InvalidBitmapLine
- ( **x** ) 00004031 CERR_CannotReadBitmapFile
- ( ) 00004032 CERR_IndexDoesNotPointToAny
- ( ) 00004033 CERR_ReservedCharacter
- ( **x** ) 00004034 CERR_InvalidCharacter
- ( ) 00004035 CERR_InvalidCall
- ( ) 00004036 CERR_CallInVirtualKeySection
- ( ) 00004037 CERR_CodeInvalidInKeyStore
- ( **x** ) 00004038 CERR_CannotLoadIncludeFile
- ( **x** ) 00004039 CERR_60FeatureOnly_EthnologueCode
- ( **x** ) 0000403A CERR_60FeatureOnly_MnemonicLayout
- ( ) 0000403B CERR_60FeatureOnly_OldCharPosMatching
- ( ) 0000403C CERR_60FeatureOnly_NamedCodes
- ( ) 0000403D CERR_60FeatureOnly_Contextn
- ( **x** ) 0000403E CERR_501FeatureOnly_Call
- ( ) 0000403F CERR_InvalidNamedCode
- ( **x** ) 00004040 CERR_InvalidSystemStore
- ( **x** ) 00004044 CERR_60FeatureOnly_VirtualCharKey
- ( **x** ) 00004045 CERR_VersionAlreadyIncluded
- ( **x** ) 00004046 CERR_70FeatureOnly
- ( **x** ) 00004047 CERR_80FeatureOnly
- ( ) 00004048 CERR_InvalidInVirtualKeySection
- ( **x** ) 00004049 CERR_InvalidIf
- ( **x** ) 0000404A CERR_InvalidReset
- ( **x** ) 0000404B CERR_InvalidSet
- ( **x** ) 0000404C CERR_InvalidSave
- ( **x** ) 0000404D CERR_InvalidEthnologueCode
- ( ) 0000804E CERR_CannotCreateTempfile
- ( **x** ) 0000404F CERR_90FeatureOnly_IfSystemStores
- ( ) 00004050 CERR_IfSystemStore_NotFound
- ( ) 00004051 CERR_90FeatureOnly_SetSystemStores
- ( ) 00004052 CERR_SetSystemStore_NotFound
- ( ) 00004053 CERR_90FeatureOnlyVirtualKeyDictionary
- ( ) 00004054 CERR_NotSupportedInKeymanWebContext
- ( ) 00004055 CERR_NotSupportedInKeymanWebOutput
- ( ) 00004056 CERR_NotSupportedInKeymanWebStore
- ( ) 00004057 CERR_VirtualCharacterKeysNotSupportedInKeymanWeb
- ( ) 00004058 CERR_VirtualKeysNotValidForMnemonicLayouts
- ( ) 00004059 CERR_InvalidTouchLayoutFile
- ( ) 0000405A CERR_TouchLayoutInvalidIdentifier
- ( ) 0000405B CERR_InvalidKeyCode
- ( **x** ) 0000405C CERR_90FeatureOnlyLayoutFile
- ( **x** ) 0000405D CERR_90FeatureOnlyKeyboardVersion
- ( **x** ) 0000405E CERR_KeyboardVersionFormatInvalid
- ( ) 0000405F CERR_ContextExHasInvalidOffset
- ( **x** ) 00004060 CERR_90FeatureOnlyEmbedCSS
- ( **x** ) 00004061 CERR_90FeatureOnlyTargets
- ( ) 00004062 CERR_ContextAndIndexInvalidInMatchNomatch
- ( ) 00004063 CERR_140FeatureOnlyContextAndNotAnyWeb
- ( **x** ) 00004064 CERR_ExpansionMustFollowCharacterOrVKey
- ( ) 00004065 CERR_VKeyExpansionMustBeFollowedByVKey
- ( ) 00004066 CERR_CharacterExpansionMustBeFollowedByCharacter
- ( ) 00004067 CERR_VKeyExpansionMustUseConsistentShift
- ( ) 00004068 CERR_ExpansionMustBePositive
- ( ) 00004069 CERR_CasedKeysMustContainOnlyVirtualKeys
- ( ) 0000406A CERR_CasedKeysMustNotIncludeShiftStates
- ( ) 0000406B CERR_CasedKeysNotSupportedWithMnemonicLayout
- ( ) 0000406C CERR_CannotUseReadWriteGroupFromReadonlyGroup
- ( ) 0000406D CERR_StatementNotPermittedInReadonlyGroup
- ( ) 0000406E CERR_OutputInReadonlyGroup
- ( ) 0000406F CERR_NewContextGroupMustBeReadonly
- ( ) 00004070 CERR_PostKeystrokeGroupMustBeReadonly
- ( **x** ) 00004071 CERR_DuplicateGroup
- ( **x** ) 00004072 CERR_DuplicateStore
- ( **x** ) 00004073 CERR_RepeatedBegin
+
+
+| | Error Number | CERR_
+| :-: | :-----------:| :-------------------------------------
+| | 00000800 | CERR_LEXICAL_MODEL_MIN
+| | 000008FF | CERR_LEXICAL_MODEL_MAX
+| | 00000800 | CERR_LEXICAL_MODEL_MIN
+| | 000008FF | CERR_LEXICAL_MODEL_MAX
+| | 00000000 | CERR_None
+| | 00000001 | CERR_EndOfFile
+| | 00008002 | CERR_BadCallParams
+| | 00008004 | CERR_CannotAllocateMemory
+| | 00008005 | CERR_InfileNotExist
+| | 00008006 | CERR_CannotCreateOutfile
+| | 00008007 | CERR_UnableToWriteFully
+| | 00008008 | CERR_CannotReadInfile
+| | 00008009 | CERR_SomewhereIGotItWrong
+|**X**| 0000400A | CERR_InvalidToken
+| | 0000400B | CERR_InvalidBegin
+| | 0000400C | CERR_InvalidName
+|**X**| 0000400D | CERR_InvalidVersion
+|**X**| 0000400E | CERR_InvalidLanguageLine
+| | 0000400F | CERR_LayoutButNoLanguage
+| | 00004010 | CERR_InvalidLayoutLine
+| | 00004011 | CERR_NoVersionLine
+| | 00004012 | CERR_InvalidGroupLine
+|**X**| 00004013 | CERR_InvalidStoreLine
+| | 00004014 | CERR_InvalidCodeInKeyPartOfRule
+|**X**| 00004015 | CERR_InvalidDeadkey
+|**X**| 00004016 | CERR_InvalidValue
+|**X**| 00004017 | CERR_ZeroLengthString
+| | 00004018 | CERR_TooManyIndexToKeyRefs
+|**X**| 00004019 | CERR_UnterminatedString
+| | 0000401A | CERR_StringInVirtualKeySection
+| | 0000401B | CERR_AnyInVirtualKeySection
+| | 0000401C | CERR_InvalidAny
+|**X**| 0000401D | CERR_StoreDoesNotExist
+| | 0000401E | CERR_BeepInVirtualKeySection
+| | 0000401F | CERR_IndexInVirtualKeySection
+| | 00004020 | CERR_InvalidIndex
+| | 00004021 | CERR_OutsInVirtualKeySection
+| | 00004022 | CERR_InvalidOuts
+| | 00004024 | CERR_ContextInVirtualKeySection
+| | 00004025 | CERR_InvalidUse
+|**X**| 00004026 | CERR_GroupDoesNotExist
+| | 00004027 | CERR_VirtualKeyNotAllowedHere
+| | 00004028 | CERR_InvalidSwitch
+|**X**| 00004029 | CERR_NoTokensFound
+| | 0000402A | CERR_InvalidLineContinuation
+|**X**| 0000402B | CERR_LineTooLong
+| | 0000402C | CERR_InvalidCopyright
+|**X**| 0000402D | CERR_CodeInvalidInThisSection
+| | 0000402E | CERR_InvalidMessage
+| | 0000402F | CERR_InvalidLanguageName
+| | 00004030 | CERR_InvalidBitmapLine
+|**X**| 00004031 | CERR_CannotReadBitmapFile
+| | 00004032 | CERR_IndexDoesNotPointToAny
+| | 00004033 | CERR_ReservedCharacter
+|**X**| 00004034 | CERR_InvalidCharacter
+| | 00004035 | CERR_InvalidCall
+| | 00004036 | CERR_CallInVirtualKeySection
+| | 00004037 | CERR_CodeInvalidInKeyStore
+|**X**| 00004038 | CERR_CannotLoadIncludeFile
+|**X**| 00004039 | CERR_60FeatureOnly_EthnologueCode
+|**X**| 0000403A | CERR_60FeatureOnly_MnemonicLayout
+| | 0000403B | CERR_60FeatureOnly_OldCharPosMatching
+| | 0000403C | CERR_60FeatureOnly_NamedCodes
+| | 0000403D | CERR_60FeatureOnly_Contextn
+|**X**| 0000403E | CERR_501FeatureOnly_Call
+| | 0000403F | CERR_InvalidNamedCode
+|**X**| 00004040 | CERR_InvalidSystemStore
+|**X**| 00004044 | CERR_60FeatureOnly_VirtualCharKey
+|**X**| 00004045 | CERR_VersionAlreadyIncluded
+|**X**| 00004046 | CERR_70FeatureOnly
+|**X**| 00004047 | CERR_80FeatureOnly
+| | 00004048 | CERR_InvalidInVirtualKeySection
+|**X**| 00004049 | CERR_InvalidIf
+|**X**| 0000404A | CERR_InvalidReset
+|**X**| 0000404B | CERR_InvalidSet
+|**X**| 0000404C | CERR_InvalidSave
+|**X**| 0000404D | CERR_InvalidEthnologueCode
+| | 0000804E | CERR_CannotCreateTempfile
+|**X**| 0000404F | CERR_90FeatureOnly_IfSystemStores
+| | 00004050 | CERR_IfSystemStore_NotFound
+| | 00004051 | CERR_90FeatureOnly_SetSystemStores
+| | 00004052 | CERR_SetSystemStore_NotFound
+| | 00004053 | CERR_90FeatureOnlyVirtualKeyDictionary
+| | 00004054 | CERR_NotSupportedInKeymanWebContext
+| | 00004055 | CERR_NotSupportedInKeymanWebOutput
+| | 00004056 | CERR_NotSupportedInKeymanWebStore
+| | 00004057 | CERR_VirtualCharacterKeysNotSupportedInKeymanWeb
+| | 00004058 | CERR_VirtualKeysNotValidForMnemonicLayouts
+| | 00004059 | CERR_InvalidTouchLayoutFile
+| | 0000405A | CERR_TouchLayoutInvalidIdentifier
+| | 0000405B | CERR_InvalidKeyCode
+|**X**| 0000405C | CERR_90FeatureOnlyLayoutFile
+|**X**| 0000405D | CERR_90FeatureOnlyKeyboardVersion
+|**X**| 0000405E | CERR_KeyboardVersionFormatInvalid
+| | 0000405F | CERR_ContextExHasInvalidOffset
+|**X**| 00004060 | CERR_90FeatureOnlyEmbedCSS
+|**X**| 00004061 | CERR_90FeatureOnlyTargets
+| | 00004062 | CERR_ContextAndIndexInvalidInMatchNomatch
+| | 00004063 | CERR_140FeatureOnlyContextAndNotAnyWeb
+|**X**| 00004064 | CERR_ExpansionMustFollowCharacterOrVKey
+|**X**| 00004065 | CERR_VKeyExpansionMustBeFollowedByVKey
+|**X**| 00004066 | CERR_CharacterExpansionMustBeFollowedByCharacter
+|**X**| 00004067 | CERR_VKeyExpansionMustUseConsistentShift
+|**X**| 00004068 | CERR_ExpansionMustBePositive
+|**X**| 00004069 | CERR_CasedKeysMustContainOnlyVirtualKeys
+|**X**| 0000406A | CERR_CasedKeysMustNotIncludeShiftStates
+|**X**| 0000406B | CERR_CasedKeysNotSupportedWithMnemonicLayout
+|**X**| 0000406C | CERR_CannotUseReadWriteGroupFromReadonlyGroup
+| | 0000406D | CERR_StatementNotPermittedInReadonlyGroup
+|**X**| 0000406E | CERR_OutputInReadonlyGroup
+|**X**| 0000406F | CERR_NewContextGroupMustBeReadonly
+|**X**| 00004070 | CERR_PostKeystrokeGroupMustBeReadonly
+|**X**| 00004071 | CERR_DuplicateGroup
+|**X**| 00004072 | CERR_DuplicateStore
+|**X**| 00004073 | CERR_RepeatedBegin
+|**X**| 000080C0 | CERR_BufferOverflow
diff --git a/common/test/keyboards/invalid/source/CERR_4065_test_expansion_invalid.kmn b/common/test/keyboards/invalid/source/CERR_4065_test_expansion_invalid.kmn
new file mode 100644
index 0000000000..b721946537
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_4065_test_expansion_invalid.kmn
@@ -0,0 +1,34 @@
+c This file tests that invalid expansions are caught
+store(&NAME) 'Test Invalid Expansions'
+begin Unicode > use(main)
+
+group(main) using keys
+
+c Backward ranges
+
+store(char_range_backward) 'c' .. 'a'
+store(key_range_backward) [K_E] .. [K_A]
+
+store(char_range_empty) 'c' .. 'c'
+store(key_range_empty) [K_E] .. [K_E]
+
+c Incomplete ranges
+
+store(range_open) ..
+store(char_range_open_end) 'a' ..
+store(char_range_open_start) .. 'z'
+
+store(key_range_open_end) [K_A] ..
+store(key_range_open_start) .. [K_Z]
+
+c Inconsistent ranges
+
+store(char_range_to_key) 'a' .. [K_Z]
+store(key_range_to_char) [K_A] .. 'z'
+
+store(char_range_to_statement) 'a' .. nul
+store(key_range_to_statement) [K_A] .. nul
+store(char_range_from_statement) nul .. 'a'
+store(key_range_from_statement) nul .. [K_A]
+
+store(key_range_shift_inconsistent) [SHIFT K_A] .. [K_Z]
diff --git a/common/test/keyboards/invalid/source/CERR_4066_test_expansion_invalid.kmn b/common/test/keyboards/invalid/source/CERR_4066_test_expansion_invalid.kmn
new file mode 100644
index 0000000000..b721946537
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_4066_test_expansion_invalid.kmn
@@ -0,0 +1,34 @@
+c This file tests that invalid expansions are caught
+store(&NAME) 'Test Invalid Expansions'
+begin Unicode > use(main)
+
+group(main) using keys
+
+c Backward ranges
+
+store(char_range_backward) 'c' .. 'a'
+store(key_range_backward) [K_E] .. [K_A]
+
+store(char_range_empty) 'c' .. 'c'
+store(key_range_empty) [K_E] .. [K_E]
+
+c Incomplete ranges
+
+store(range_open) ..
+store(char_range_open_end) 'a' ..
+store(char_range_open_start) .. 'z'
+
+store(key_range_open_end) [K_A] ..
+store(key_range_open_start) .. [K_Z]
+
+c Inconsistent ranges
+
+store(char_range_to_key) 'a' .. [K_Z]
+store(key_range_to_char) [K_A] .. 'z'
+
+store(char_range_to_statement) 'a' .. nul
+store(key_range_to_statement) [K_A] .. nul
+store(char_range_from_statement) nul .. 'a'
+store(key_range_from_statement) nul .. [K_A]
+
+store(key_range_shift_inconsistent) [SHIFT K_A] .. [K_Z]
diff --git a/common/test/keyboards/invalid/source/CERR_4067_test_expansion_invalid.kmn b/common/test/keyboards/invalid/source/CERR_4067_test_expansion_invalid.kmn
new file mode 100644
index 0000000000..b721946537
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_4067_test_expansion_invalid.kmn
@@ -0,0 +1,34 @@
+c This file tests that invalid expansions are caught
+store(&NAME) 'Test Invalid Expansions'
+begin Unicode > use(main)
+
+group(main) using keys
+
+c Backward ranges
+
+store(char_range_backward) 'c' .. 'a'
+store(key_range_backward) [K_E] .. [K_A]
+
+store(char_range_empty) 'c' .. 'c'
+store(key_range_empty) [K_E] .. [K_E]
+
+c Incomplete ranges
+
+store(range_open) ..
+store(char_range_open_end) 'a' ..
+store(char_range_open_start) .. 'z'
+
+store(key_range_open_end) [K_A] ..
+store(key_range_open_start) .. [K_Z]
+
+c Inconsistent ranges
+
+store(char_range_to_key) 'a' .. [K_Z]
+store(key_range_to_char) [K_A] .. 'z'
+
+store(char_range_to_statement) 'a' .. nul
+store(key_range_to_statement) [K_A] .. nul
+store(char_range_from_statement) nul .. 'a'
+store(key_range_from_statement) nul .. [K_A]
+
+store(key_range_shift_inconsistent) [SHIFT K_A] .. [K_Z]
diff --git a/common/test/keyboards/invalid/source/CERR_4068_test_expansion_invalid.kmn b/common/test/keyboards/invalid/source/CERR_4068_test_expansion_invalid.kmn
new file mode 100644
index 0000000000..b721946537
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_4068_test_expansion_invalid.kmn
@@ -0,0 +1,34 @@
+c This file tests that invalid expansions are caught
+store(&NAME) 'Test Invalid Expansions'
+begin Unicode > use(main)
+
+group(main) using keys
+
+c Backward ranges
+
+store(char_range_backward) 'c' .. 'a'
+store(key_range_backward) [K_E] .. [K_A]
+
+store(char_range_empty) 'c' .. 'c'
+store(key_range_empty) [K_E] .. [K_E]
+
+c Incomplete ranges
+
+store(range_open) ..
+store(char_range_open_end) 'a' ..
+store(char_range_open_start) .. 'z'
+
+store(key_range_open_end) [K_A] ..
+store(key_range_open_start) .. [K_Z]
+
+c Inconsistent ranges
+
+store(char_range_to_key) 'a' .. [K_Z]
+store(key_range_to_char) [K_A] .. 'z'
+
+store(char_range_to_statement) 'a' .. nul
+store(key_range_to_statement) [K_A] .. nul
+store(char_range_from_statement) nul .. 'a'
+store(key_range_from_statement) nul .. [K_A]
+
+store(key_range_shift_inconsistent) [SHIFT K_A] .. [K_Z]
diff --git a/common/test/keyboards/invalid/source/CERR_4069_test_casedkeys_invalid_1.kmn b/common/test/keyboards/invalid/source/CERR_4069_test_casedkeys_invalid_1.kmn
new file mode 100644
index 0000000000..8bc65cced6
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_4069_test_casedkeys_invalid_1.kmn
@@ -0,0 +1,10 @@
+c Tests cased keys - invalid codes
+store(&NAME) 'Test &CasedKeys'
+begin Unicode > use(main)
+
+group(main) using keys
+
+store(&CasedKeys) U+1000
+
++ [K_A] > 'aaah'
++ [SHIFT K_A] > 'AAAH'
diff --git a/common/test/keyboards/invalid/source/CERR_406A_test_casedkeys_invalid_2.kmn b/common/test/keyboards/invalid/source/CERR_406A_test_casedkeys_invalid_2.kmn
new file mode 100644
index 0000000000..508466c07e
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_406A_test_casedkeys_invalid_2.kmn
@@ -0,0 +1,10 @@
+c Tests cased keys - invalid codes
+store(&NAME) 'Test &CasedKeys'
+begin Unicode > use(main)
+
+group(main) using keys
+
+store(&CasedKeys) [SHIFT K_1]
+
++ [K_A] > 'aaah'
++ [SHIFT K_A] > 'AAAH'
diff --git a/common/test/keyboards/invalid/source/CERR_406B_test_casedkeys_mnemonic_1.kmn b/common/test/keyboards/invalid/source/CERR_406B_test_casedkeys_mnemonic_1.kmn
new file mode 100644
index 0000000000..40b0bbb966
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_406B_test_casedkeys_mnemonic_1.kmn
@@ -0,0 +1,11 @@
+c Tests cased keys - invalid with mnemonic layout
+store(&NAME) 'Test &CasedKeys'
+store(&mnemoniclayout) '1'
+begin Unicode > use(main)
+
+group(main) using keys
+
+store(&CasedKeys) [K_A] [K_E] [K_I] [K_O] [K_U] [K_1] .. [K_4]
+
++ [K_A] > 'aaah'
++ [SHIFT K_A] > 'AAAH'
diff --git a/common/test/keyboards/invalid/source/CERR_406C_test_5963_readonlygroup_usenonreadonly.kmn b/common/test/keyboards/invalid/source/CERR_406C_test_5963_readonlygroup_usenonreadonly.kmn
new file mode 100644
index 0000000000..8ced461fc7
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_406C_test_5963_readonlygroup_usenonreadonly.kmn
@@ -0,0 +1,12 @@
+c should fail to compile, readonly group uses() non-readonly group
+
+begin Unicode > use(main)
+
+group(main) using keys
+
+group(foo) readonly
+
+'a' > use(bar)
+
+group(bar)
+
diff --git a/common/test/keyboards/invalid/source/CERR_406E_test_5963_readonlygroup_misplacedcontext.kmn b/common/test/keyboards/invalid/source/CERR_406E_test_5963_readonlygroup_misplacedcontext.kmn
new file mode 100644
index 0000000000..251a3d1033
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_406E_test_5963_readonlygroup_misplacedcontext.kmn
@@ -0,0 +1,11 @@
+c Should fail to compile, `context` must be omitted or first statement in output
+
+begin Unicode > use(main)
+
+group(main) using keys
+
+group(foo) readonly
+
+'a' > use(bar) context
+
+group(bar) readonly
diff --git a/common/test/keyboards/invalid/source/CERR_406F_test_5963_newcontext_2.kmn b/common/test/keyboards/invalid/source/CERR_406F_test_5963_newcontext_2.kmn
new file mode 100644
index 0000000000..a2916de43a
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_406F_test_5963_newcontext_2.kmn
@@ -0,0 +1,9 @@
+c Should fail to compile, group is not readonly
+
+begin Unicode > use(main)
+begin NewContext > use(NewContext)
+
+group(NewContext)
+
+group(main) using keys
+
diff --git a/common/test/keyboards/invalid/source/CERR_4070_test_5963_postkeystroke_2.kmn b/common/test/keyboards/invalid/source/CERR_4070_test_5963_postkeystroke_2.kmn
new file mode 100644
index 0000000000..12bb366150
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_4070_test_5963_postkeystroke_2.kmn
@@ -0,0 +1,8 @@
+c Should fail to compile, group is not readonly
+
+begin Unicode > use(main)
+begin PostKeystroke > use(PostKeystroke)
+
+group(PostKeystroke)
+
+group(main) using keys
diff --git a/common/test/keyboards/invalid/source/CERR_80C0_test_expansion_absurd.kmn b/common/test/keyboards/invalid/source/CERR_80C0_test_expansion_absurd.kmn
new file mode 100644
index 0000000000..905093bc87
--- /dev/null
+++ b/common/test/keyboards/invalid/source/CERR_80C0_test_expansion_absurd.kmn
@@ -0,0 +1,7 @@
+c This file tests absurdly long expansions
+store(&NAME) 'Test Expansions'
+begin Unicode > use(main)
+
+group(main) using keys
+
+store(schar_range) U+0020 .. U+10FFFF