mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
3e651fb8df
// FREEBIE
28 lines
997 B
Swift
28 lines
997 B
Swift
//
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
import XCTest
|
|
|
|
class DisplayableTextFilterTest: XCTestCase {
|
|
|
|
override func setUp() {
|
|
super.setUp()
|
|
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
}
|
|
|
|
override func tearDown() {
|
|
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
super.tearDown()
|
|
}
|
|
|
|
func testFiltering() {
|
|
// Ignore default byte size limitations to test other filtering behaviors
|
|
let filter = DisplayableTextFilter(allowAnyTextLessThanByteSize: 0)
|
|
|
|
XCTAssertFalse( filter.shouldPreventDisplay(text: "normal text") )
|
|
XCTAssertFalse( filter.shouldPreventDisplay(text: "🇹🇹🌼🇹🇹🌼🇹🇹") )
|
|
XCTAssertTrue( filter.shouldPreventDisplay(text: "L̷̳͔̲͝Ģ̵̮̯̤̩̙͍̬̟͉̹̘̹͍͈̮̦̰̣͟͝O̶̴̮̻̮̗͘͡!̴̷̟͓͓") )
|
|
}
|
|
}
|