-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
10,779 additions
and
1,576 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Security.Policy; | ||
using NUnit.Framework; | ||
using RTLTMPro; | ||
using UnityEngine; | ||
using UnityEngine.TestTools; | ||
|
||
namespace Tests | ||
{ | ||
public class RTLSupportTests | ||
{ | ||
[Test] | ||
public void ArabicTextIsSuccessfulyConverted() | ||
{ | ||
const string input = "هَذَا النَّص العربي"; | ||
const string expected = "ﻲﺑﺮﻌﻟا ﺺﱠﻨﻟا اَﺬَﻫ"; | ||
|
||
var support = new RTLSupport | ||
{ | ||
Farsi = false, PreserveNumbers = true, FixTextTags = false | ||
}; | ||
|
||
string result = support.FixRTL(input); | ||
|
||
Assert.AreEqual(expected, result); | ||
} | ||
|
||
[Test] | ||
public void FarsiTextIsSuccessfulyConverted() | ||
{ | ||
const string input = "متن فارسی"; | ||
const string expected = "ﯽﺳرﺎﻓ ﻦﺘﻣ"; | ||
|
||
var support = new RTLSupport | ||
{ | ||
Farsi = true, PreserveNumbers = true, FixTextTags = false | ||
}; | ||
|
||
string result = support.FixRTL(input); | ||
|
||
Assert.AreEqual(expected, result); | ||
} | ||
|
||
[Test] | ||
public void TashkeelIsMaintainedInBeginingOfText() | ||
{ | ||
const string input = "ِصبا"; | ||
const string expected = "ِﺎﺒﺻ"; | ||
|
||
var support = new RTLSupport | ||
{ | ||
Farsi = true, PreserveNumbers = true, FixTextTags = false | ||
}; | ||
|
||
string result = support.FixRTL(input); | ||
|
||
Assert.AreEqual(expected, result); | ||
} | ||
|
||
[Test] | ||
public void TashkeelIsMaintainedInMiddleOfText() | ||
{ | ||
const string input = "مَرد"; | ||
const string expected = "دﺮَﻣ"; | ||
|
||
var support = new RTLSupport | ||
{ | ||
Farsi = true, PreserveNumbers = true, FixTextTags = false | ||
}; | ||
|
||
string result = support.FixRTL(input); | ||
|
||
Assert.AreEqual(expected, result); | ||
} | ||
|
||
[Test] | ||
public void TashkeelIsMaintainedInEndOfText() | ||
{ | ||
const string input = "صبحِ"; | ||
const string expected = "ِﺢﺒﺻ"; | ||
|
||
var support = new RTLSupport | ||
{ | ||
Farsi = true, PreserveNumbers = true, FixTextTags = false | ||
}; | ||
|
||
string result = support.FixRTL(input); | ||
|
||
Assert.AreEqual(expected, result); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
{ | ||
"name": "RTLTMPro-Tests", | ||
"references": [ | ||
"RTLTMPro" | ||
], | ||
"optionalUnityReferences": [ | ||
"TestAssemblies" | ||
], | ||
"includePlatforms": [ | ||
"Editor" | ||
], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,7 @@ | ||
Font: IRANSansDN Pt. Size: 98 | ||
Characters packed: 163/165 | ||
|
||
Missing Characters | ||
---------------------------------------- | ||
ID: 64396 Hex: FB8C Char [ﮌ] | ||
ID: 64397 Hex: FB8D Char [ﮍ] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.