Skip to content

Commit

Permalink
Fix LT-21895: Add test projects to PhonologyServices
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmaxwell3 authored and jasonleenaylor committed Sep 3, 2024
1 parent c3b1d64 commit 198da6c
Show file tree
Hide file tree
Showing 14 changed files with 47,300 additions and 0 deletions.
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

0 comments on commit 198da6c

Please sign in to comment.