MastoSearch/MastoSearchTests/ImportControllerTests.swift

24 lines
699 B
Swift
Raw Normal View History

2022-07-03 06:52:41 +00:00
//
// ImportControllerTests.swift
// MastoSearchTests
//
// Created by Shadowfacts on 2/20/22.
//
import XCTest
@testable import MastoSearch
class ImportControllerTests: XCTestCase {
func testFlakeID() {
XCTAssertEqual(ImportController.shared.uuidToFlakeIdStr("00000000-0000-0000-0000-00000005bb9e"), "375710")
XCTAssertEqual(ImportController.shared.uuidToFlakeIdStr("00000177-5ba7-ee59-630b-a5bae0760000"), "A3okOJuhGRi5vgGEpk")
}
func testEncodeBase62() {
XCTAssertEqual(ImportController.shared.encodeBase62(4_815_162_342), "5Frvgk")
XCTAssertEqual(ImportController.shared.encodeBase62(9_223_372_036_854_775_807), "AzL8n0Y58m7")
}
}