mirror of
https://github.com/apple/swift-nio-extras
synced 2026-11-28 05:14:24 +00:00
Provide a decoder for frames with a fixed length. Motivation: This was motivated by the issue https://github.com/apple/swift-nio/issues/474 as a good first issue. Modifications: Implemented a FixedLengthFrameDecoder as well as tests. Result: Users can decode fixed length frames.
37 lines
1.2 KiB
Swift
37 lines
1.2 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftNIO open source project
|
|
//
|
|
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// FixedLengthDecoderTest+XCTest.swift
|
|
//
|
|
import XCTest
|
|
|
|
///
|
|
/// NOTE: This file was generated by generate_linux_tests.rb
|
|
///
|
|
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
|
|
///
|
|
|
|
extension FixedLengthFrameDecoderTest {
|
|
|
|
static var allTests : [(String, (FixedLengthFrameDecoderTest) -> () throws -> Void)] {
|
|
return [
|
|
("testDecodeIfFewerBytesAreSent", testDecodeIfFewerBytesAreSent),
|
|
("testDecodeIfMoreBytesAreSent", testDecodeIfMoreBytesAreSent),
|
|
("testRemoveHandlerWhenBufferIsNotEmpty", testRemoveHandlerWhenBufferIsNotEmpty),
|
|
("testRemoveHandlerWhenBufferIsEmpty", testRemoveHandlerWhenBufferIsEmpty),
|
|
]
|
|
}
|
|
}
|
|
|