summaryrefslogtreecommitdiffstats
path: root/BaseTools/Tests
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2015-06-23 23:34:43 +0000
committerjljusten <jljusten@Edk2>2015-06-23 23:34:43 +0000
commit156d6d65a5ac1e31d36381b7726c42066891a845 (patch)
treef76eb198aafe76212d18acf3a813005f528dd2d1 /BaseTools/Tests
parent8fb5a0cae32261d8650c9d6bb645c10872b8426f (diff)
downloadedk2-156d6d65a5ac1e31d36381b7726c42066891a845.tar.gz
edk2-156d6d65a5ac1e31d36381b7726c42066891a845.tar.bz2
edk2-156d6d65a5ac1e31d36381b7726c42066891a845.zip
BaseTools/Tests: Verify supported UTF-8 data is allowed
We test a simple case of UTF-8 with and without the UTF-8 BOM. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17699 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Tests')
-rw-r--r--BaseTools/Tests/CheckUnicodeSourceFiles.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/BaseTools/Tests/CheckUnicodeSourceFiles.py b/BaseTools/Tests/CheckUnicodeSourceFiles.py
index 2eeb0f551d..6ae62f180a 100644
--- a/BaseTools/Tests/CheckUnicodeSourceFiles.py
+++ b/BaseTools/Tests/CheckUnicodeSourceFiles.py
@@ -114,6 +114,17 @@ class Tests(TestTools.BaseToolsTest):
self.CheckFile(encoding=None, shouldPass=False, string=data)
+ def testValidUtf8File(self):
+ self.CheckFile(encoding='utf_8', shouldPass=True)
+
+ def testValidUtf8FileWithBom(self):
+ #
+ # Same test as testValidUtf8File, but add the UTF-8 BOM
+ #
+ data = codecs.BOM_UTF8 + codecs.encode(self.SampleData, 'utf_8')
+
+ self.CheckFile(encoding=None, shouldPass=True, string=data)
+
def test32bitUnicodeCharInUtf8File(self):
data = u'''
#langdef en-US "English"