Browse Source

Bug - 修复 RTF 格式,字符解析出错导致对比结果为0的问题;

zhudongyong 1 year ago
parent
commit
fcb3c205c2

BIN
KdanAutoTest/KdanAuto.xcodeproj/project.xcworkspace/xcuserdata/zhudongyong.xcuserdatad/UserInterfaceState.xcuserstate


+ 63 - 0
KdanAutoTest/KdanAuto.xcodeproj/xcuserdata/zhudongyong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -308,5 +308,68 @@
             landmarkType = "7">
             landmarkType = "7">
          </BreakpointContent>
          </BreakpointContent>
       </BreakpointProxy>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "EB2A18C8-13D9-4B4E-B281-F5C3CA9A8E13"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KdanAuto/Class/AutoTestCase/StringAutoTest.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "502"
+            endingLineNumber = "502"
+            landmarkName = "readTextFile(_:)"
+            landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "EB2A18C8-13D9-4B4E-B281-F5C3CA9A8E13 - 487ef373f16bc286"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "function signature specialization &lt;Arg[1] = Dead&gt; of KdanAuto.StringAutoTest.readTextFile(__C.NSString) -&gt; Swift.Optional&lt;Swift.String&gt;"
+                  moduleName = "KdanAuto"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/MacintoshHD/WorkSpace_zdy/Work/Git/AutoTest/KdanAutoTest/KdanAuto/Class/AutoTestCase/StringAutoTest.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "502"
+                  endingLineNumber = "502"
+                  offsetFromSymbolStart = "80">
+               </Location>
+               <Location
+                  uuid = "EB2A18C8-13D9-4B4E-B281-F5C3CA9A8E13 - 5a964bd094bdda66"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "KdanAuto.StringAutoTest.readTextFile(__C.NSString) -&gt; Swift.Optional&lt;Swift.String&gt;"
+                  moduleName = "KdanAuto"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/MacintoshHD/WorkSpace_zdy/Work/Git/AutoTest/KdanAutoTest/KdanAuto/Class/AutoTestCase/StringAutoTest.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "502"
+                  endingLineNumber = "502"
+                  offsetFromSymbolStart = "434">
+               </Location>
+               <Location
+                  uuid = "EB2A18C8-13D9-4B4E-B281-F5C3CA9A8E13 - 5a964bd094bdda66"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "KdanAuto.StringAutoTest.readTextFile(__C.NSString) -&gt; Swift.Optional&lt;Swift.String&gt;"
+                  moduleName = "KdanAuto"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Volumes/MacintoshHD/WorkSpace_zdy/Work/Git/AutoTest/KdanAutoTest/KdanAuto/Class/AutoTestCase/StringAutoTest.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "502"
+                  endingLineNumber = "502"
+                  offsetFromSymbolStart = "445">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
    </Breakpoints>
 </Bucket>
 </Bucket>

+ 3 - 3
KdanAutoTest/KdanAuto/Class/AutoTestCase/StringAutoTest.swift

@@ -513,12 +513,12 @@ class StringAutoTest : AutoTest {
             var documentAttributes:NSDictionary!
             var documentAttributes:NSDictionary!
             let checkAttString = NSAttributedString.init(rtf: checkData, documentAttributes: &documentAttributes)
             let checkAttString = NSAttributedString.init(rtf: checkData, documentAttributes: &documentAttributes)
             var checkString = NSString(string: checkAttString!.string) as NSString
             var checkString = NSString(string: checkAttString!.string) as NSString
-//            checkString = checkString.replacingOccurrences(of: "\n", with: "") as NSString
-//            checkString = checkString.replacingOccurrences(of: " ", with: "") as NSString
+            var pureString = checkString.replacingOccurrences(of: "\n", with: "") as NSString
+            pureString = pureString.replacingOccurrences(of: " ", with: "") as NSString
             // 常规 rtf 读取失败
             // 常规 rtf 读取失败
             
             
             //使用框排进行读取
             //使用框排进行读取
-            if (checkString.length > 0) {
+            if (pureString.length > 0) {
                 return checkString as String?
                 return checkString as String?
             }
             }