Files
AzooKeyKanaKanjiConverter/Tests/SwiftUtilsTests/WithMutableValueTests.swift
2023-07-23 00:34:27 +09:00

22 lines
470 B
Swift

//
// WithMutableValueTests.swift
// azooKeyTests
//
// Created by ensan on 2022/12/22.
// Copyright © 2022 ensan. All rights reserved.
//
@testable import SwiftUtils
import XCTest
final class WithMutableValueTests: XCTestCase {
func testWithMutableValue() throws {
var array = [0, 1, 2, 3]
withMutableValue(&array[1]) { value in
value = value * value + value / value
}
XCTAssertEqual(array, [0, 2, 2, 3])
}
}