File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Sources/SourceParsingFramework/Utilities
Tests/SourceParsingFrameworkTests/Utilities Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 11language : objective-c
2- osx_image : xcode11.2
2+ osx_image : xcode11.4
33
44env :
55 - ACTION=test PLATFORM=Mac DESTINATION='platform=OS X'
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ extension String {
2222
2323 /// The SHA256 value of this String.
2424 public var shortSHA256Value : String {
25- return SHA256 ( self ) . digestString ( ) . substring ( with: NSRange ( location: 0 , length: 20 ) ) !
25+ return SHA256 ( ) . hash ( self ) . hexadecimalRepresentation . substring ( with: NSRange ( location: 0 , length: 20 ) ) !
2626 }
2727
2828 /// Return the same String with the first character lowercased.
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ class ExtensionsTests: AbstractSourceParsingTests {
3030 dirPath = String ( filePath. prefix ( upTo: index) )
3131 }
3232
33+ func test_sha256_verifyResults( ) {
34+ let input = " Some random string "
35+ let sha256 = input. shortSHA256Value
36+ XCTAssertEqual ( sha256, " 7e2ab276842ae9fb52ae " )
37+ }
38+
3339 func test_isDirectory_verifyResults( ) {
3440 XCTAssertFalse ( filePath. isDirectory)
3541 XCTAssertTrue ( dirPath. isDirectory)
You can’t perform that action at this time.
0 commit comments