-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(developer): unit tests for kmc-generate
Note: these are more e2e than unit tests. It may be difficult to convert them into solid unit tests due to the way that kmc-generate works based on templates.
- Loading branch information
Showing
39 changed files
with
860 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* c8 ignore start */ | ||
export { AbstractGenerator, GeneratorOptions } from "./abstract-generator.js"; | ||
export { KeymanKeyboardGenerator } from "./keyman-keyboard-generator.js"; | ||
export { LexicalModelGenerator } from "./lexical-model-generator.js"; | ||
export { LdmlKeyboardGenerator } from "./ldml-keyboard-generator.js"; | ||
export { GeneratorMessages } from "./generator-messages.js"; | ||
export { GeneratorMessages } from "./generator-messages.js"; |
6 changes: 6 additions & 0 deletions
6
developer/src/kmc-generate/test/fixtures/keyman-keyboard/sample/HISTORY.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Sample Project Change History | ||
==================== | ||
|
||
1.0 (2024-04-12) | ||
---------------- | ||
* Created by Sample Author |
21 changes: 21 additions & 0 deletions
21
developer/src/kmc-generate/test/fixtures/keyman-keyboard/sample/LICENSE.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
© 2024 TheAuthor | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
18 changes: 18 additions & 0 deletions
18
developer/src/kmc-generate/test/fixtures/keyman-keyboard/sample/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Sample Project keyboard | ||
============== | ||
|
||
Description | ||
----------- | ||
# A mighty description | ||
|
||
Links | ||
----- | ||
Keyboard Homepage: https://keyman.com/keyboards/sample | ||
|
||
Copyright | ||
--------- | ||
See [LICENSE.md](LICENSE.md) | ||
|
||
Supported Platforms | ||
------------------- | ||
* Windows |
8 changes: 8 additions & 0 deletions
8
developer/src/kmc-generate/test/fixtures/keyman-keyboard/sample/sample.kpj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<KeymanDeveloperProject> | ||
<Options> | ||
<Version>2.0</Version> | ||
<CompilerWarningsAsErrors>True</CompilerWarningsAsErrors> | ||
<CheckFilenameConventions>True</CheckFilenameConventions> | ||
</Options> | ||
</KeymanDeveloperProject> |
24 changes: 24 additions & 0 deletions
24
developer/src/kmc-generate/test/fixtures/keyman-keyboard/sample/source/readme.htm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Sample Project</title> | ||
<style type="text/css"> | ||
p { font: 10pt Tahoma; } | ||
h1 { font: bold 16pt Tahoma; color: #4444cc; margin-bottom: 2px } | ||
h2 { font: bold 12pt Tahoma; color: #4444cc; } | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<h1>Sample Project</h1> | ||
|
||
<p> | ||
# A mighty description | ||
</p> | ||
|
||
<p>© TheAuthor</p> | ||
|
||
</body> | ||
</html> |
12 changes: 12 additions & 0 deletions
12
developer/src/kmc-generate/test/fixtures/keyman-keyboard/sample/source/sample.kmn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
c keyboard generated from template at 2024-04-12 | ||
c with name "Sample Project" | ||
store(&NAME) 'Sample Project' | ||
store(©RIGHT) '© TheAuthor' | ||
store(&VERSION) '10.0' | ||
store(&KEYBOARDVERSION) '1.0' | ||
store(&TARGETS) 'windows' | ||
store(&VISUALKEYBOARD) 'sample.kvks' | ||
|
||
begin Unicode > use(main) | ||
|
||
group(main) using keys |
61 changes: 61 additions & 0 deletions
61
developer/src/kmc-generate/test/fixtures/keyman-keyboard/sample/source/sample.kps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Package> | ||
<System> | ||
<KeymanDeveloperVersion>17.0.292.0</KeymanDeveloperVersion> | ||
<FileVersion>7.0</FileVersion> | ||
</System> | ||
<Options> | ||
<ReadMeFile>readme.htm</ReadMeFile> | ||
<LicenseFile>..\LICENSE.md</LicenseFile> | ||
<WelcomeFile>welcome.htm</WelcomeFile> | ||
<FollowKeyboardVersion/> | ||
</Options> | ||
<Info> | ||
<Name URL="">Sample Project</Name> | ||
<Copyright URL="">© TheAuthor</Copyright> | ||
<Author URL="">Sample Author</Author> | ||
<Description URL=""># A mighty description</Description> | ||
</Info> | ||
<Files> | ||
<File> | ||
<Name>..\build\sample.kmx</Name> | ||
<Description></Description> | ||
<CopyLocation>0</CopyLocation> | ||
<FileType>.kmx</FileType> | ||
</File> | ||
<File> | ||
<Name>..\build\sample.kvk</Name> | ||
<Description></Description> | ||
<CopyLocation>0</CopyLocation> | ||
<FileType>.kvk</FileType> | ||
</File> | ||
<File> | ||
<Name>welcome.htm</Name> | ||
<Description></Description> | ||
<CopyLocation>0</CopyLocation> | ||
<FileType>.htm</FileType> | ||
</File> | ||
<File> | ||
<Name>readme.htm</Name> | ||
<Description></Description> | ||
<CopyLocation>0</CopyLocation> | ||
<FileType>.htm</FileType> | ||
</File> | ||
<File> | ||
<Name>..\LICENSE.md</Name> | ||
<Description></Description> | ||
<CopyLocation>0</CopyLocation> | ||
<FileType>.md</FileType> | ||
</File> | ||
</Files> | ||
<Keyboards> | ||
<Keyboard> | ||
<Name>Sample Project</Name> | ||
<ID>sample</ID> | ||
<Version>1.0</Version> | ||
<Languages> | ||
<Language ID="en">en</Language> | ||
</Languages> | ||
</Keyboard> | ||
</Keyboards> | ||
</Package> |
8 changes: 8 additions & 0 deletions
8
developer/src/kmc-generate/test/fixtures/keyman-keyboard/sample/source/sample.kvks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<visualkeyboard> | ||
<header> | ||
<version>10.0</version> | ||
<kbdname>sample</kbdname> | ||
<flags/> | ||
</header> | ||
</visualkeyboard> |
26 changes: 26 additions & 0 deletions
26
developer/src/kmc-generate/test/fixtures/keyman-keyboard/sample/source/welcome.htm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Start Using Sample Project</title> | ||
<style type="text/css"> | ||
p { font: 10pt Tahoma; } | ||
h1 { font: bold 16pt Tahoma; color: #4444cc; margin-bottom: 2px } | ||
h2 { font: bold 12pt Tahoma; color: #4444cc; } | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<h1>Start Using Sample Project</h1> | ||
|
||
<p> | ||
# A mighty description | ||
</p> | ||
|
||
<h1>Keyboard Layout</h1> | ||
|
||
<!-- Insert Keyboard Layout Images or HTML here --> | ||
|
||
</body> | ||
</html> |
6 changes: 6 additions & 0 deletions
6
developer/src/kmc-generate/test/fixtures/ldml-keyboard/sample/HISTORY.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Sample Project Change History | ||
==================== | ||
|
||
1.0 (2024-04-12) | ||
---------------- | ||
* Created by Sample Author |
21 changes: 21 additions & 0 deletions
21
developer/src/kmc-generate/test/fixtures/ldml-keyboard/sample/LICENSE.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
© 2024 TheAuthor | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
18 changes: 18 additions & 0 deletions
18
developer/src/kmc-generate/test/fixtures/ldml-keyboard/sample/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Sample Project keyboard | ||
============== | ||
|
||
Description | ||
----------- | ||
# A mighty description | ||
|
||
Links | ||
----- | ||
Keyboard Homepage: https://keyman.com/keyboards/sample | ||
|
||
Copyright | ||
--------- | ||
See [LICENSE.md](LICENSE.md) | ||
|
||
Supported Platforms | ||
------------------- | ||
* Windows |
8 changes: 8 additions & 0 deletions
8
developer/src/kmc-generate/test/fixtures/ldml-keyboard/sample/sample.kpj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<KeymanDeveloperProject> | ||
<Options> | ||
<Version>2.0</Version> | ||
<CompilerWarningsAsErrors>True</CompilerWarningsAsErrors> | ||
<CheckFilenameConventions>True</CheckFilenameConventions> | ||
</Options> | ||
</KeymanDeveloperProject> |
24 changes: 24 additions & 0 deletions
24
developer/src/kmc-generate/test/fixtures/ldml-keyboard/sample/source/readme.htm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Sample Project</title> | ||
<style type="text/css"> | ||
p { font: 10pt Tahoma; } | ||
h1 { font: bold 16pt Tahoma; color: #4444cc; margin-bottom: 2px } | ||
h2 { font: bold 12pt Tahoma; color: #4444cc; } | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<h1>Sample Project</h1> | ||
|
||
<p> | ||
# A mighty description | ||
</p> | ||
|
||
<p>© TheAuthor</p> | ||
|
||
</body> | ||
</html> |
61 changes: 61 additions & 0 deletions
61
developer/src/kmc-generate/test/fixtures/ldml-keyboard/sample/source/sample.kps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Package> | ||
<System> | ||
<KeymanDeveloperVersion>17.0.292.0</KeymanDeveloperVersion> | ||
<FileVersion>7.0</FileVersion> | ||
</System> | ||
<Options> | ||
<ReadMeFile>readme.htm</ReadMeFile> | ||
<LicenseFile>..\LICENSE.md</LicenseFile> | ||
<WelcomeFile>welcome.htm</WelcomeFile> | ||
<FollowKeyboardVersion/> | ||
</Options> | ||
<Info> | ||
<Name URL="">Sample Project</Name> | ||
<Copyright URL="">© TheAuthor</Copyright> | ||
<Author URL="">Sample Author</Author> | ||
<Description URL=""># A mighty description</Description> | ||
</Info> | ||
<Files> | ||
<File> | ||
<Name>..\build\sample.kmx</Name> | ||
<Description></Description> | ||
<CopyLocation>0</CopyLocation> | ||
<FileType>.kmx</FileType> | ||
</File> | ||
<File> | ||
<Name>..\build\sample.kvk</Name> | ||
<Description></Description> | ||
<CopyLocation>0</CopyLocation> | ||
<FileType>.kvk</FileType> | ||
</File> | ||
<File> | ||
<Name>welcome.htm</Name> | ||
<Description></Description> | ||
<CopyLocation>0</CopyLocation> | ||
<FileType>.htm</FileType> | ||
</File> | ||
<File> | ||
<Name>readme.htm</Name> | ||
<Description></Description> | ||
<CopyLocation>0</CopyLocation> | ||
<FileType>.htm</FileType> | ||
</File> | ||
<File> | ||
<Name>..\LICENSE.md</Name> | ||
<Description></Description> | ||
<CopyLocation>0</CopyLocation> | ||
<FileType>.md</FileType> | ||
</File> | ||
</Files> | ||
<Keyboards> | ||
<Keyboard> | ||
<Name>Sample Project</Name> | ||
<ID>sample</ID> | ||
<Version>1.0</Version> | ||
<Languages> | ||
<Language ID="en">en</Language> | ||
</Languages> | ||
</Keyboard> | ||
</Keyboards> | ||
</Package> |
Oops, something went wrong.