Follow-on from https://github.com/PowerShell/PowerShell/issues/13462 and #13779
There are some debug asserts used in... I think the parser? or the Token file itself? One of those... that ensures that the token names are matched 1:1 with token types. Perhaps something similar would help for the PSToken API? Since any changes to either will be easily noticed in debug builds.
Quote from @iSazonov (https://github.com/PowerShell/PowerShell/pull/13779#issuecomment-708149421)
As for test, we could add temporary internal static method to check a consistency of s_tokenKindMapping and other static mappings in xUnit test.