Skip to content

Commit 22507c1

Browse files
committed
Swift: Add a test for UITextField.
1 parent 2c28fae commit 22507c1

File tree

1 file changed

+30
-0
lines changed
  • swift/ql/test/library-tests/dataflow/flowsources

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// --- stubs ---
2+
3+
class NSObject { }
4+
class NSAttributedString: NSObject {}
5+
class UIResponder: NSObject {}
6+
class UIView: UIResponder {}
7+
class UIControl: UIView {}
8+
class UITextField: UIControl {
9+
var text: String? {
10+
get { nil }
11+
set { }
12+
}
13+
var attributedText: NSAttributedString? {
14+
get { nil }
15+
set { }
16+
}
17+
var placeholder: String? {
18+
get { nil }
19+
set { }
20+
}
21+
}
22+
23+
// --- tests ---
24+
25+
func testUITextField(textField: UITextField) {
26+
_ = textField.text // $ MISSING: source=local
27+
_ = textField.attributedText // $ MISSING: source=local
28+
_ = textField.placeholder // GOOD (not input)
29+
_ = textField.text?.uppercased() // $ MISSING: source=local
30+
}

0 commit comments

Comments
 (0)