|
| 1 | +//===----------------------------------------------------------------------===// |
| 2 | +// |
| 3 | +// This source file is part of the RediStack open source project |
| 4 | +// |
| 5 | +// Copyright (c) 2022 RediStack project authors |
| 6 | +// Licensed under Apache License v2.0 |
| 7 | +// |
| 8 | +// See LICENSE.txt for license information |
| 9 | +// See CONTRIBUTORS.txt for the list of RediStack project authors |
| 10 | +// |
| 11 | +// SPDX-License-Identifier: Apache-2.0 |
| 12 | +// |
| 13 | +//===----------------------------------------------------------------------===// |
| 14 | + |
| 15 | +import RediStack |
| 16 | +import XCTest |
| 17 | + |
| 18 | +final class RedisCommandTests: XCTestCase { } |
| 19 | + |
| 20 | +// MARK: Equatable Tests |
| 21 | + |
| 22 | +extension RedisCommandTests { |
| 23 | + func test_equatableConformance() { |
| 24 | + let first = RedisCommand<String>(keyword: #function, arguments: []) |
| 25 | + let second = RedisCommand<String>(keyword: #function, arguments: []) |
| 26 | + XCTAssertEqual(first, second) |
| 27 | + |
| 28 | + let third = RedisCommand<String>(keyword: #function, arguments: [#line.convertedToRESPValue()]) |
| 29 | + XCTAssertNotEqual(first, third) |
| 30 | + XCTAssertNotEqual(second, third) |
| 31 | + |
| 32 | + let fourth = RedisCommand<String>(keyword: "buzz", arguments: []) |
| 33 | + XCTAssertNotEqual(first, fourth) |
| 34 | + XCTAssertNotEqual(third, fourth) |
| 35 | + } |
| 36 | +} |
0 commit comments