Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LT-21895: Add test projects to PhonologyServices #312

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/SIL.LCModel.Tests/DomainServices/PhonologyServicesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ private void SetDefaultVernacularWritingSystem(LcmCache cache, CoreWritingSystem
m_cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem = vernWritingSystem);
}

private void TestProjects(string directory)
{
foreach (string subdir in Directory.GetDirectories(directory))
foreach (string file in Directory.GetFiles(subdir, "*.fwdata"))
{
CreateTestCache();
TestProject(subdir, file);
DestroyTestCache();
}
}

private void TestProject(string projectsDirectory, string dbFileName)
{
var projectId = new TestProjectId(BackendProviderType.kXML, dbFileName);
Expand Down Expand Up @@ -1223,5 +1234,15 @@ public void TestPhonologicalFeatures()
TestXml(xdoc, xdoc2);
}
}

private string PhonologyProjectsDirectory => Path.Combine(TestDirectoryFinder.RootDirectory, "tests", "SIL.LCModel.Tests", "DomainServices", "TestData", "PhonologyProjects");

[Test]
public void TestPhonologyProjects()
{
// You can test your personal projects with something like
// TestProjects("C:\\Users\\[MyAccount]\\FieldWorks\\DistFiles\\Projects")
TestProjects(PhonologyProjectsDirectory);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<ProjectLexiconSettings>
<WritingSystems>
<WritingSystem id="en">
<Abbreviation>Eng</Abbreviation>
<LanguageName>English</LanguageName>
</WritingSystem>
<WritingSystem id="ms">
<Abbreviation>Mal</Abbreviation>
<LanguageName>Malay (macrolanguage)</LanguageName>
<SystemCollation />
</WritingSystem>
<WritingSystem id="kqr">
<Abbreviation>Kim</Abbreviation>
<LanguageName>Kimaragang</LanguageName>
</WritingSystem>
</WritingSystems>
</ProjectLexiconSettings>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<UserLexiconSettings>
<WritingSystems>
<WritingSystem id="en">
<LocalKeyboard>en-US_English</LocalKeyboard>
<DefaultFontName>Charis SIL</DefaultFontName>
</WritingSystem>
<WritingSystem id="ms">
<LocalKeyboard>en-US_English</LocalKeyboard>
<DefaultFontName>Charis SIL</DefaultFontName>
</WritingSystem>
<WritingSystem id="kqr">
<LocalKeyboard>en-US_English</LocalKeyboard>
<DefaultFontName>Charis SIL</DefaultFontName>
</WritingSystem>
</WritingSystems>
</UserLexiconSettings>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<WritingSystemChangeLog
Version="1">
<Changes>
<Add
Producer="???"
ProducerVersion="unknown"
TimeStamp="2024-08-30T15:06:05Z">
<Id>en</Id>
</Add>
<Add
Producer="???"
ProducerVersion="unknown"
TimeStamp="2024-08-30T15:06:05Z">
<Id>ms</Id>
</Add>
<Add
Producer="???"
ProducerVersion="unknown"
TimeStamp="2024-08-30T15:06:05Z">
<Id>kqr</Id>
</Add>
</Changes>
</WritingSystemChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<ldml>
<identity>
<version number="" />
<generation date="2024-08-30T15:06:05Z" />
<language type="kqr" />
</identity>
<characters>
<exemplarCharacters>['\-\u00B2\u00B3\u00B9\u0F0B\u0F0C\u200C\u200D\u2070\u2074-\u2079\uA78B\uA78C]</exemplarCharacters>
<exemplarCharacters type="punctuation">[]</exemplarCharacters>
</characters>
<layout>
<orientation>
<characterOrder>left-to-right</characterOrder>
</orientation>
</layout>
<collations>
<defaultCollation>standard</defaultCollation>
<collation type="standard">
<cr><![CDATA[& n < N << ng < Ng << ny < Ny]]></cr>
</collation>
</collations>
<special xmlns:sil="urn://www.sil.org/ldml/0.1">
<sil:external-resources>
<sil:font name="Charis SIL" types="default" />
</sil:external-resources>
</special>
</ldml>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<ldml>
<identity>
<version number="" />
<generation date="2024-08-30T15:06:05Z" />
<language type="ms" />
<special xmlns:sil="urn://www.sil.org/ldml/0.1">
<sil:identity windowsLCID="1086" />
</special>
</identity>
<layout>
<orientation>
<characterOrder>left-to-right</characterOrder>
</orientation>
</layout>
<special xmlns:sil="urn://www.sil.org/ldml/0.1">
<sil:external-resources>
<sil:font name="Charis SIL" types="default" />
</sil:external-resources>
</special>
</ldml>
Loading
Loading