summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/expected/cs/10045-UNI-1288.cs
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-11-18 17:53:35 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-11-19 19:27:29 +0900
commitc0a6f1b84c84749908961579b84513fd9f9d9eac (patch)
treeace7ba60cb031acd3a1f4ff10f7bbc5668fa801f /debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/expected/cs/10045-UNI-1288.cs
parent52e5ffe140f0f4402e97936447bc9a606045d2b5 (diff)
downloadextra-dependencies-c0a6f1b84c84749908961579b84513fd9f9d9eac.tar.gz
extra-dependencies-c0a6f1b84c84749908961579b84513fd9f9d9eac.zip
uncrustify-trinity: updated based on upstream version 0.78.0
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/expected/cs/10045-UNI-1288.cs')
-rw-r--r--debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/expected/cs/10045-UNI-1288.cs77
1 files changed, 77 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/expected/cs/10045-UNI-1288.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/expected/cs/10045-UNI-1288.cs
new file mode 100644
index 00000000..03d60f5b
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/expected/cs/10045-UNI-1288.cs
@@ -0,0 +1,77 @@
+public class Class
+{
+ public Foo GetFoo()
+ {
+ return new Foo
+ {
+ enabled = false,
+ };
+ }
+
+ public override Bar GetBar()
+ {
+ return new Bar()
+ {
+ m_Name = TestPropertyName
+ };
+ return new
+ AA();
+ return new AA<Type>
+ {
+ };
+ }
+
+ //It appears uncrustify is adding double-indentation no matter what, to the initializer block.
+ // Both of the above examples start out at a different level of indentation, and both get double-indented past original.
+}
+
+// The following code consolidates examples from the topic.
+class ObjInitializers
+{
+ class Cat
+ {
+ // Auto-implemented properties.
+ public int Age { get; set; }
+ public string Name { get; set; }
+ }
+
+ static void Main()
+ {
+ Cat cat = new Cat { Age = 10, Name = "Fluffy" };
+
+ List<Cat> cats = new List<Cat>
+ {
+ new Cat() { Name = "Sylvester", Age = 8 },
+ new Cat() { Name = "Whiskers", Age = 2 },
+ new Cat() { Name = "Sasha", Age = 14 }
+ };
+
+ List<Cat> moreCats = new List<Cat>
+ {
+ new Cat() { Name = "Furrytail", Age = 5 },
+ new Cat() { Name = "Peaches", Age = 4 },
+ null
+ };
+
+ // Display results.
+ System.Console.WriteLine(cat.Name);
+
+ foreach (Cat c in cats)
+ System.Console.WriteLine(c.Name);
+
+ foreach (Cat c in moreCats)
+ if (c != null)
+ System.Console.WriteLine(c.Name);
+ else
+ System.Console.WriteLine("List element has null value.");
+ }
+
+ // Output:
+ //Fluffy
+ //Sylvester
+ //Whiskers
+ //Sasha
+ //Furrytail
+ //Peaches
+ //List element has null value.
+}