mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Swift: Add a test for UITextField.
This commit is contained in:
30
swift/ql/test/library-tests/dataflow/flowsources/uikit.swift
Normal file
30
swift/ql/test/library-tests/dataflow/flowsources/uikit.swift
Normal file
@@ -0,0 +1,30 @@
|
||||
// --- stubs ---
|
||||
|
||||
class NSObject { }
|
||||
class NSAttributedString: NSObject {}
|
||||
class UIResponder: NSObject {}
|
||||
class UIView: UIResponder {}
|
||||
class UIControl: UIView {}
|
||||
class UITextField: UIControl {
|
||||
var text: String? {
|
||||
get { nil }
|
||||
set { }
|
||||
}
|
||||
var attributedText: NSAttributedString? {
|
||||
get { nil }
|
||||
set { }
|
||||
}
|
||||
var placeholder: String? {
|
||||
get { nil }
|
||||
set { }
|
||||
}
|
||||
}
|
||||
|
||||
// --- tests ---
|
||||
|
||||
func testUITextField(textField: UITextField) {
|
||||
_ = textField.text // $ MISSING: source=local
|
||||
_ = textField.attributedText // $ MISSING: source=local
|
||||
_ = textField.placeholder // GOOD (not input)
|
||||
_ = textField.text?.uppercased() // $ MISSING: source=local
|
||||
}
|
||||
Reference in New Issue
Block a user