|
| 1 | +//===----------------------------------------------------------------------===// |
| 2 | +// |
| 3 | +// This source file is part of the swift-libgit2 open source project. |
| 4 | +// |
| 5 | +// Copyright (c) Margins Technologies LLC. |
| 6 | +// Licensed under the Apache License, Version 2.0. |
| 7 | +// |
| 8 | +//===----------------------------------------------------------------------===// |
| 9 | + |
| 10 | +import CLibgit2 |
| 11 | +import XCTest |
| 12 | +@testable import SwiftLibgit2 |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | +final class RemoteAdvancedTests: XCTestCaseStopOnFail |
| 17 | +{ |
| 18 | + func testGitRemoteCapabilityT() throws |
| 19 | + { |
| 20 | + XCTAssertEqual(GitRemoteCapabilityT.gitRemoteCapabilityTipOID.rawValue, GIT_REMOTE_CAPABILITY_TIP_OID.rawValue) |
| 21 | + XCTAssertEqual(GitRemoteCapabilityT.gitRemoteCapabilityReachableOID.rawValue, GIT_REMOTE_CAPABILITY_REACHABLE_OID.rawValue) |
| 22 | + XCTAssertEqual(GitRemoteCapabilityT.gitRemoteCapabilityPushOptions.rawValue, GIT_REMOTE_CAPABILITY_PUSH_OPTIONS.rawValue) |
| 23 | + |
| 24 | + XCTAssertEqual(GitRemoteCapabilityT(rawValue: 123).cValue().rawValue, 123) |
| 25 | + |
| 26 | + XCTAssertEqual(GitRemoteCapabilityT.gitRemoteCapabilityTipOID.cValue(), GIT_REMOTE_CAPABILITY_TIP_OID) |
| 27 | + XCTAssertEqual(GitRemoteCapabilityT.gitRemoteCapabilityReachableOID.cValue(), GIT_REMOTE_CAPABILITY_REACHABLE_OID) |
| 28 | + XCTAssertEqual(GitRemoteCapabilityT.gitRemoteCapabilityPushOptions.cValue(), GIT_REMOTE_CAPABILITY_PUSH_OPTIONS) |
| 29 | + |
| 30 | + XCTAssertEqual(GitRemoteCapabilityT(cValue: GIT_REMOTE_CAPABILITY_TIP_OID), .gitRemoteCapabilityTipOID) |
| 31 | + XCTAssertEqual(GitRemoteCapabilityT(cValue: GIT_REMOTE_CAPABILITY_REACHABLE_OID), .gitRemoteCapabilityReachableOID) |
| 32 | + XCTAssertEqual(GitRemoteCapabilityT(cValue: GIT_REMOTE_CAPABILITY_PUSH_OPTIONS), .gitRemoteCapabilityPushOptions) |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + let flags: GitRemoteCapabilityT = |
| 37 | + [ |
| 38 | + .gitRemoteCapabilityTipOID, |
| 39 | + .gitRemoteCapabilityReachableOID |
| 40 | + ] |
| 41 | + |
| 42 | + XCTAssertTrue(flags.contains(.gitRemoteCapabilityTipOID)) |
| 43 | + XCTAssertTrue(flags.contains(.gitRemoteCapabilityReachableOID)) |
| 44 | + XCTAssertFalse(flags.contains(.gitRemoteCapabilityPushOptions)) |
| 45 | + } |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + func testGitRemoteConnectOptionsDispose() throws |
| 50 | + { |
| 51 | + gitRemoteConnectOptionsDispose(opts: nil) |
| 52 | + } |
| 53 | +} |
0 commit comments