Revision: 17699
          http://sourceforge.net/p/edk2/code/17699
Author:   jljusten
Date:     2015-06-23 23:34:43 +0000 (Tue, 23 Jun 2015)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
Reviewed-by: Yingke Liu <[email protected]>

Modified Paths:
--------------
    trunk/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py

Modified: trunk/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py
===================================================================
--- trunk/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py       2015-06-23 
23:34:38 UTC (rev 17698)
+++ trunk/edk2/BaseTools/Tests/CheckUnicodeSourceFiles.py       2015-06-23 
23:34:43 UTC (rev 17699)
@@ -114,6 +114,17 @@
 
         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"


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to