diff options
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala')
15 files changed, 294 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70000-list.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70000-list.vala new file mode 100644 index 00000000..1893dcb5 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70000-list.vala @@ -0,0 +1,22 @@ + + +using GLib; + +public class GListTest : Object +{ + public GListTest { } + + static int main(string[] args) + { + List<string> list; + list.append("TestString1"); + list.append("myTest"); + message("list.length()=%d", list.length()); + + for (int i = 0; i < list.length(); i++) + { + string list2 = list.nth_data(i); + message("%s", list2); + } + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70001-advanced.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70001-advanced.vala new file mode 100644 index 00000000..c1d581c5 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70001-advanced.vala @@ -0,0 +1,30 @@ +/* Advanced Vala Sample Code */ +using GLib; +public class Sample : Object { + public string name { get; set; } + public signal void foo(); + public Sample (construct string !name) + { + } + public void run() + { + foo += s => { + stdout.printf("Lambda expression %s!\n", name); + }; + + /* Calling lambda expression */ + foo(); + } + static int main(string[] args) + { + foreach (string arg in args) + { + var sample = new Sample(arg); + sample.run(); + /* Object will automatically be freed + * at the end of the block */ + } + return(0); + } +} + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70010-verbatim_str.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70010-verbatim_str.vala new file mode 100644 index 00000000..12c1f1a3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70010-verbatim_str.vala @@ -0,0 +1,36 @@ +/* Advanced Vala Sample Code */ +using GLib; +public class Sample : Object { + public string name { get; set; } + public signal void foo(); + public Sample (construct string !name) + { + } + public void run() + { + foo += s => { + stdout.printf("Lambda expression %s!\n", name); + }; + + /* Calling lambda expression */ + foo(); + } + static int main(string[] args) + { + string sql = """ SELECT name "my_name" + FROM table + WHERE id='4' + """; + var where = """ WHERE name LIKE '%blah% + """; + + foreach (string arg in args) + { + var sample = new Sample(arg); + sample.run(); + /* Object will automatically be freed + * at the end of the block */ + } + return(0); + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70011-verbatim_str2.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70011-verbatim_str2.vala new file mode 100644 index 00000000..fc745113 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70011-verbatim_str2.vala @@ -0,0 +1,39 @@ +/* Advanced Vala Sample Code */ +using GLib; +public class Sample : Object { + public string name { get; set; } + public signal void foo(); + public Sample (construct string !name) + { + } + public void run() + { + foo += s => { + stdout.printf("Lambda expression %s!\n", name); + }; + + /* Calling lambda expression */ + foo(); + } + static int main(string[] args) + { + string sql = """SELECT name "my_name" + FROM table + WHERE id='4' +"""; + var where = """ WHERE name LIKE '%blah% + """ ; + + foreach (string arg in args) + { + var sample = new Sample(arg); + sample.run(); + /* Object will automatically be freed + * at the end of the block + * a tab b + * c tab d + */ + } + return(0); + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70012-verbatim_str2.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70012-verbatim_str2.vala new file mode 100644 index 00000000..edd0ea67 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70012-verbatim_str2.vala @@ -0,0 +1,39 @@ +/* Advanced Vala Sample Code */ +using GLib; +public class Sample : Object { + public string name { get; set; } + public signal void foo(); + public Sample (construct string !name) + { + } + public void run() + { + foo += s => { + stdout.printf("Lambda expression %s!\n", name); + }; + + /* Calling lambda expression */ + foo(); + } + static int main(string[] args) + { + string sql = """SELECT name "my_name" + FROM table + WHERE id='4' +"""; + var where = """ WHERE name LIKE '%blah% + """; + + foreach (string arg in args) + { + var sample = new Sample(arg); + sample.run(); + /* Object will automatically be freed + * at the end of the block + * a tab b + * c tab d + */ + } + return(0); + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70020-preproc.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70020-preproc.vala new file mode 100644 index 00000000..9cc1ba1a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70020-preproc.vala @@ -0,0 +1,12 @@ +int main() +{ +#if WANT_TO_COMPILE_THIS + gtkwidget.clicked.connect((widdget) => { message("Clicked"); + }); +#else + gtkwidget.enabled.connect((widdget) => { + message("Clicked"); + }); +#endif + return(0); +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70287-gh287.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70287-gh287.vala new file mode 100644 index 00000000..be39a9db --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70287-gh287.vala @@ -0,0 +1,40 @@ +int main() +{ + key_press_event.connect((e) => { + switch (e.keyval) + { + case Gdk.Key.@0: + if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0) + { + action_zoom_default_font(); + return(true); + } + + break; + + case Gdk.Key.@1: //alt+[1-8] + case Gdk.Key.@7: + case Gdk.Key.@8: + if (((e.state & Gdk.ModifierType.MOD1_MASK) != 0) && settings.alt_changes_tab) + { + var i = e.keyval - 49; + if (i > notebook.n_tabs - 1) + { + return(false); + } + + notebook.current = notebook.get_tab_by_index((int)i); + return(true); + } + + break; + + default: + assert_not_reached(); + } + + return(false); + }); + + return(0); +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70300-Issue_2090.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70300-Issue_2090.vala new file mode 100644 index 00000000..5b4e1716 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70300-Issue_2090.vala @@ -0,0 +1 @@ +int ? some_int = null; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70301-Issue_2270.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70301-Issue_2270.vala new file mode 100644 index 00000000..2202627c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70301-Issue_2270.vala @@ -0,0 +1 @@ +new Gtk.Label (_ ("Label text")); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70302-cast.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70302-cast.vala new file mode 100644 index 00000000..6c5d11db --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70302-cast.vala @@ -0,0 +1,7 @@ +foo = (Type) bar; + +foo = (Ns.Type) bar; + +foo = (Type<int>) bar; + +foo = (Type<int, int>) bar; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70303-nullable.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70303-nullable.vala new file mode 100644 index 00000000..54c24643 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70303-nullable.vala @@ -0,0 +1,14 @@ +Vector2? a; +Vector2 b; + +void G() +{ + int? x = true ? null : (int?)2; + var q = x == null ? y : z; + var q2 = x == q ? y : z; + var q3 = x == null ? (y = new Y()) : z; + var q4 = x == q ? (y = new Y()) : z; + + var q5 = x == null ? y = new Y() : z; + var q6 = x == q ? y = new Y() : z; +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70304-identifier.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70304-identifier.vala new file mode 100644 index 00000000..5dee8d3b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70304-identifier.vala @@ -0,0 +1,47 @@ +namespace ns +{ +// You can omit '@' in trivial 'type func-name' definitions. +void if() { +} +void else() { +} +void foreach() { +} + +// Numeric identifiers require '@'. +int @123star() { +} + +// Non-primitive return types require '@'. +Foo @while() { +} +} + +public static int main() +{ + // You can omit '@' in trivial 'type var;' declarations. + int for; + int while = 1; + int do; + + // Non-primitive types always require '@'. + Foo @do; + + // Slightly more complex 'type var_list;' require '@'. + int @if, @else, @for, @do, @while; + + // This will complain about missing '(' etc. + // int if, else, for, do, while; + + // It is common to omit '@' when accessing methods. + ns.if(); + ns.else(); + ns.do(); + ns.while(); + ns.foreach(); + + // Numeric methods always require '@'. + ns.@123star(); + + return 0; +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70310-mdarray_space.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70310-mdarray_space.vala new file mode 100644 index 00000000..6fd7c360 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70310-mdarray_space.vala @@ -0,0 +1,2 @@ +int[ , , ] x; +var y = new int[2, 3]; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70311-mdarray_space.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70311-mdarray_space.vala new file mode 100644 index 00000000..c8a51c1e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70311-mdarray_space.vala @@ -0,0 +1,2 @@ +int[,,] x; +var y = new int[2, 3]; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70312-mdarray_space.vala b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70312-mdarray_space.vala new file mode 100644 index 00000000..cf64a5e2 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.1/tests/expected/vala/70312-mdarray_space.vala @@ -0,0 +1,2 @@ +int[, ,] x; +var y = new int[2, 3]; |