damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

NdbTests.swift (1317B)


      1 //
      2 //  NDBIterTests.swift
      3 //  damusTests
      4 //
      5 //  Created by William Casarin on 2023-07-21.
      6 //
      7 
      8 import XCTest
      9 @testable import damus
     10 
     11 final class NdbTests: XCTestCase {
     12 
     13     override func setUpWithError() throws {
     14         // Put setup code here. This method is called before the invocation of each test method in the class.
     15     }
     16 
     17     override func tearDownWithError() throws {
     18         // Put teardown code here. This method is called after the invocation of each test method in the class.
     19     }
     20 
     21     func test_ndb_note() throws {
     22         let note = NdbNote.owned_from_json(json: test_contact_list_json)
     23         XCTAssertNotNil(note)
     24         guard let note else { return }
     25 
     26         let id = "20d0ff27d6fcb13de8366328c5b1a7af26bcac07f2e558fbebd5e9242e608c09"
     27         XCTAssertEqual(hex_encode(note.id), id)
     28 
     29         XCTAssertEqual(note.tags().underestimatedCount, 786)
     30         XCTAssertEqual(note.tags().underestimatedCount, 786)
     31 
     32         //let tags = note.tags()
     33         for tag in note.tags() {
     34             for elem in tag {
     35                 print("test_ndb_iterator \(elem.)")
     36             }
     37         }
     38 
     39     }
     40 
     41     func testPerformanceExample() throws {
     42         // This is an example of a performance test case.
     43         self.measure {
     44             // Put the code you want to measure the time of here.
     45         }
     46     }
     47 
     48 }