<commit_before>//
//  FontExtensionTests.swift
//  Tests
//
//  CotEditor
//  https://coteditor.com
//
//  Created by 1024jp on 2016-06-10.
//
//  ---------------------------------------------------------------------------
//
//  © 2016-2020 1024jp
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//  https://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//

import XCTest
@testable import CotEditor

final class FontExtensionTests: XCTestCase {
    
    func testFontSize() {
        
        let font = NSFont(name: "Menlo-Regular", size: 11)
        
        XCTAssertEqual(font?.spaceWidth, 6.62255859375)
    }
    
    
    func testNamedFont() {
        
        let menlo = NSFont(named: .menlo, size: 11)
        XCTAssertNotNil(menlo)
        XCTAssertEqual(menlo, NSFont(name: "Menlo-Regular", size: 11))
        
        let avenirNextCondensed = NSFont(named: .avenirNextCondensed, weight: .bold, size: 11)
        XCTAssertNotNil(avenirNextCondensed)
        XCTAssertEqual(avenirNextCondensed, NSFont(name: "AvenirNextCondensed-Bold", size: 11))
    }
    
}<commit_msg>Fix a test case for NSFont<commit_after>//
//  FontExtensionTests.swift
//  Tests
//
//  CotEditor
//  https://coteditor.com
//
//  Created by 1024jp on 2016-06-10.
//
//  ---------------------------------------------------------------------------
//
//  © 2016-2020 1024jp
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//  https://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//

import XCTest
@testable import CotEditor

final class FontExtensionTests: XCTestCase {
    
    func testFontSize() {
        
        let font = NSFont(name: "Menlo-Regular", size: 11)
        
        XCTAssertEqual(font?.width(of: " "), 6.62255859375)
    }
    
    
    func testNamedFont() {
        
        let menlo = NSFont(named: .menlo, size: 11)
        XCTAssertNotNil(menlo)
        XCTAssertEqual(menlo, NSFont(name: "Menlo-Regular", size: 11))
        
        let avenirNextCondensed = NSFont(named: .avenirNextCondensed, weight: .bold, size: 11)
        XCTAssertNotNil(avenirNextCondensed)
        XCTAssertEqual(avenirNextCondensed, NSFont(name: "AvenirNextCondensed-Bold", size: 11))
    }
    
}
{'fraction_non_alphanumeric': 0.15114405414115373, 'fraction_numerical': 0.03222687721559781, 'mean_word_length': 2.219917012448133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4798101', 'n_tokens_mistral': 1001, 'n_tokens_neox': 913, 'n_words': 281}