mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 15:05:26 +00:00
22 lines
470 B
Swift
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])
|
|
}
|
|
|
|
}
|