summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2016-11-07 20:49:14 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2016-11-07 21:27:36 +0100
commitf2abdf6c72e083c78e5a2008e381ec76f27aad97 (patch)
treeee941d1a8fb5aa1968f838f2176fbeb6d5e65de7 /tests
parentab96b471875951fb0c85188b220d275c4496b955 (diff)
downloadvala-f2abdf6c72e083c78e5a2008e381ec76f27aad97.tar.gz
tests: More cases of FormatArg functions
Diffstat (limited to 'tests')
-rw-r--r--tests/methods/bug774060.vala26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/methods/bug774060.vala b/tests/methods/bug774060.vala
index 84ab9c665..fe025e50c 100644
--- a/tests/methods/bug774060.vala
+++ b/tests/methods/bug774060.vala
@@ -1,7 +1,33 @@
+class Foo : Object {
+ public unowned string format (string bar, int baz, [FormatArg] string format) {
+ return format;
+ }
+
+ [CCode (instance_pos = -1)]
+ public unowned string format_pos (string bar, int baz, [FormatArg] string format) {
+ return format;
+ }
+
+ [NoWrapper]
+ public virtual unowned string format_virtual (string bar, int baz, [FormatArg] string format) {
+ return format;
+ }
+
+ public static unowned string format_static (string foo, int baz, [FormatArg] string format) {
+ return format;
+ }
+}
+
unowned string format_wrapper ([FormatArg] string format) {
return format;
}
void main () {
print (format_wrapper ("%d"), 42);
+
+ var foo = new Foo ();
+ print (foo.format ("", 0, "%d"), 42);
+ print (foo.format_pos ("", 0, "%d"), 42);
+ print (foo.format_virtual ("", 0, "%d"), 42);
+ print (Foo.format_static ("", 0, "%d"), 42);
}