<commit_before>/*
 This source file is part of the Swift.org open source project

 Copyright 2015 Apple Inc. and the Swift project authors
 Licensed under Apache License v2.0 with Runtime Library Exception

 See http://swift.org/LICENSE.txt for license information
 See http://swift.org/CONTRIBUTORS.txt for Swift project authors
*/

import XCTest
@testable import struct PackageDescription.Version

class VersionTests: XCTestCase, XCTestCaseProvider {

    var allTests : [(String, () -> ())] {
        return [
            ("testEquality", testEquality),
            ("testNegativeValuesBecomeZero", testNegativeValuesBecomeZero),
            ("testComparable", testComparable),
            ("testDescription", testDescription),
            ("testFromString", testFromString),
            ("testSort", testSort),
            ("testRange", testRange),
        ]
    }
    
    func testEquality() {
        func test(@autoclosure v: () -> Version) {
            XCTAssertEqual(v(), v())
        }
        
        test(Version(1,2,3))
        test(Version(0,0,0))
        test(Version(Int.min, Int.min, Int.min))
        test(Version(Int.max, Int.max, Int.max))
    }<commit_msg>[tests] Import libc to use rand()<commit_after>/*
 This source file is part of the Swift.org open source project

 Copyright 2015 Apple Inc. and the Swift project authors
 Licensed under Apache License v2.0 with Runtime Library Exception

 See http://swift.org/LICENSE.txt for license information
 See http://swift.org/CONTRIBUTORS.txt for Swift project authors
*/

import XCTest
import libc

@testable import struct PackageDescription.Version

class VersionTests: XCTestCase, XCTestCaseProvider {

    var allTests : [(String, () -> ())] {
        return [
            ("testEquality", testEquality),
            ("testNegativeValuesBecomeZero", testNegativeValuesBecomeZero),
            ("testComparable", testComparable),
            ("testDescription", testDescription),
            ("testFromString", testFromString),
            ("testSort", testSort),
            ("testRange", testRange),
        ]
    }
    
    func testEquality() {
        func test(@autoclosure v: () -> Version) {
            XCTAssertEqual(v(), v())
        }
        
        test(Version(1,2,3))
        test(Version(0,0,0))
        test(Version(Int.min, Int.min, Int.min))
        test(Version(Int.max, Int.max, Int.max))
    }
{'fraction_non_alphanumeric': 0.11533639782699541, 'fraction_numerical': 0.010029251984956121, 'mean_word_length': 2.643835616438356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4710920', 'n_tokens_mistral': 691, 'n_tokens_neox': 648, 'n_words': 177}