<commit_before>//
//  QueueTests.swift
//  Rx
//
//  Created by <NAME> on 3/21/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import Foundation
import RxSwift
import XCTest

class QueueTest : RxTest {
    
    override func setUp() {
        super.setUp()
    }
    
    override func tearDown() {
        super.tearDown()
    }
}

extension QueueTest {
    func test() {
        var queue: Queue<Int> = Queue(capacity: 2)
        
        XCTAssertEqual(queue.count, 0)
        
        for var i = 100; i < 200; i += 1 {
            queue.enqueue(i)
            
            let allElements = Array(queue)
            let correct = Array(100 ... i)
            
            XCTAssertEqual(allElements, correct)
            XCTAssertEqual(queue.peek(), 100)
            XCTAssertEqual(queue.count, i - 100 + 1)
        }
        
        for var i = 100; i < 200; i += 1 {
            let allElements2 = Array(queue)
            let correct2 = Array(i ... 199)
            
            XCTAssertEqual(allElements2, correct2)
            XCTAssertEqual(queue.dequeue(), i)
            XCTAssertEqual(queue.count, 200 - i - 1)
        }
    }
    
    func testComplexity() {
        var queue: Queue<Int> = Queue(capacity: 2)
        
        XCTAssertEqual(queue.count, 0)
        
        for var i = 0; i < 200000; i += 1 {
            queue.enqueue(i)
        }
        
        XCTAssertEqual(Array(0 ..< 200000), Array(queue))
    }
}<commit_msg>Removes C style for loops.<commit_after>//
//  QueueTests.swift
//  Rx
//
//  Created by <NAME> on 3/21/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import Foundation
import RxSwift
import XCTest

class QueueTest : RxTest {
    
    override func setUp() {
        super.setUp()
    }
    
    override func tearDown() {
        super.tearDown()
    }
}

extension QueueTest {
    func test() {
        var queue: Queue<Int> = Queue(capacity: 2)
        
        XCTAssertEqual(queue.count, 0)
        
        for i in 100 ..< 200 {
            queue.enqueue(i)
            
            let allElements = Array(queue)
            let correct = Array(100 ... i)
            
            XCTAssertEqual(allElements, correct)
            XCTAssertEqual(queue.peek(), 100)
            XCTAssertEqual(queue.count, i - 100 + 1)
        }
        
        for i in 100 ..< 200 {
            let allElements2 = Array(queue)
            let correct2 = Array(i ... 199)
            
            XCTAssertEqual(allElements2, correct2)
            XCTAssertEqual(queue.dequeue(), i)
            XCTAssertEqual(queue.count, 200 - i - 1)
        }
    }
    
    func testComplexity() {
        var queue: Queue<Int> = Queue(capacity: 2)
        
        XCTAssertEqual(queue.count, 0)
        
        for i in 0 ..< 200000 {
            queue.enqueue(i)
        }
        
        XCTAssertEqual(Array(0 ..< 200000), Array(queue))
    }
}
{'fraction_non_alphanumeric': 0.11145510835913312, 'fraction_numerical': 0.04231166150670795, 'mean_word_length': 1.4581572273879966, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 11, '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': '119450', 'n_tokens_mistral': 1019, 'n_tokens_neox': 902, 'n_words': 217}