Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arrow expression methods #80

Merged
merged 2 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Src/CSharpier.Tests/Samples/AllInOne.cst
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,14 @@ namespace My
catch { }
}
var anonymous = { A = 1, B = 2, C = 3 };
var query = from c in customers
var query =
from c in customers
let d = c
where d != null
join c1 in customers on c1.GetHashCode() equals c.GetHashCode()
join c1 in customers on c1.GetHashCode() equals c.GetHashCode() into e
join c1 in customers
on c1.GetHashCode() equals c.GetHashCode()
into e
group c by c.Country into g
orderby g.Count() ascending
orderby g.Key descending
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class ClassName
{
void MethodName()
{
Func<bool, bool> f = delegate(bool a)
{
return !a;
};

Func<bool, bool> f = async delegate(bool a)
{
return await !a;
};

Func<bool, bool> f = delegate(
string longName,
string longerName,
string longeeeeeeestName
) {
return !a;
};
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@ namespace CSharpier.Tests.TestFiles
public class AnonymousMethodExpressionTests : BaseTest
{
[Test]
public void AsyncDelegateAnonymousMethodExpression()
public void AnonymousMethodExpressions()
{
this.RunTest(
"AnonymousMethodExpression",
"AsyncDelegateAnonymousMethodExpression"
);
}
[Test]
public void BasicAnonymousMethodExpression()
{
this.RunTest(
"AnonymousMethodExpression",
"BasicAnonymousMethodExpression"
"AnonymousMethodExpressions"
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace CSharpier.Tests.TestFiles
public class CheckedStatementTests : BaseTest
{
[Test]
public void BasicCheckedStatement()
public void CheckedStatements()
{
this.RunTest("CheckedStatement", "BasicCheckedStatement");
this.RunTest("CheckedStatement", "CheckedStatements");
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,9 @@ namespace CSharpier.Tests.TestFiles
public class ConstructorDeclarationTests : BaseTest
{
[Test]
public void BasicConstructorDeclaration()
public void ConstructorDeclarations()
{
this.RunTest(
"ConstructorDeclaration",
"BasicConstructorDeclaration"
);
}
[Test]
public void ConstructorDeclarationComments()
{
this.RunTest(
"ConstructorDeclaration",
"ConstructorDeclarationComments"
);
}
[Test]
public void ConstructorDeclarationWithInitializer()
{
this.RunTest(
"ConstructorDeclaration",
"ConstructorDeclarationWithInitializer"
);
}
[Test]
public void ConstructorWithParameters()
{
this.RunTest("ConstructorDeclaration", "ConstructorWithParameters");
}
[Test]
public void LongConstructor()
{
this.RunTest("ConstructorDeclaration", "LongConstructor");
this.RunTest("ConstructorDeclaration", "ConstructorDeclarations");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ class Test
return new Test();
}

public static implicit operator Test(
OtherPerson someReallyLongNameThatWillMakeThisBreak
) {
return new Test();
}

public static implicit operator Test(Person p) =>
new Test(p.First + " " + p.Last);

public static implicit operator Test(int x) => new Test(x);

public static implicit operator Test(
bool reallyLongNameThatWillMakeThisBreak
) => new Test(x);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@ namespace CSharpier.Tests.TestFiles
public class DestructorDeclarationTests : BaseTest
{
[Test]
public void BasicDestructorDeclaration()
public void DestructorDeclarations()
{
this.RunTest("DestructorDeclaration", "BasicDestructorDeclaration");
}
[Test]
public void DestructorDeclarationWithExpressionBody()
{
this.RunTest(
"DestructorDeclaration",
"DestructorDeclarationWithExpressionBody"
);
this.RunTest("DestructorDeclaration", "DestructorDeclarations");
}
}
}

This file was deleted.

17 changes: 17 additions & 0 deletions Src/CSharpier.Tests/TestFiles/FixedStatement/FixedStatements.cst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class ClassName
{
void MethodName()
{
fixed (int* p = stackalloc int[100])
{
*intref = 1;
}

fixed (
int* someLongNameThatWillMakeThisBreakYeahKeepGoing =
stackalloc int[100]
) {
*intref = 1;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace CSharpier.Tests.TestFiles
public class FixedStatementTests : BaseTest
{
[Test]
public void BasicFixedStatement()
public void FixedStatements()
{
this.RunTest("FixedStatement", "BasicFixedStatement");
this.RunTest("FixedStatement", "FixedStatements");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ class ClassName
int,
NativeMethods.REQUEST_NOTIFICATION_STATUS> asyncCallback,
delegate* unmanaged<IntPtr, void> requestsDrainedHandler,
IntPtr pvRequestContext)
{
IntPtr pvRequestContext
) {
return;
}

public static extern unsafe int InvokeCallbackFuncPtr_Inline_NoGCTransition(
delegate* unmanaged[Cdecl]<int, int> cb,
int* n);
int* n
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class ClassName
}

if (
MethodKind is not (MethodKind.Ordinary or MethodKind.LocalFunction)
MethodKind is not (MethodKind.Ordinary
or MethodKind.LocalFunction)
) {
return;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
public class ClassName
{
public void MethodName()
{
void LocalFunction()
{
return;
}

void LocalFunctionWithParameters(
string one,
string two,
string three,
string four
) {
return;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ namespace CSharpier.Tests.TestFiles
public class LocalFunctionStatementTests : BaseTest
{
[Test]
public void BasicLocalFunctionStatement()
public void LocalFunctionStatements()
{
this.RunTest(
"LocalFunctionStatement",
"BasicLocalFunctionStatement"
);
this.RunTest("LocalFunctionStatement", "LocalFunctionStatements");
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions Src/CSharpier.Tests/TestFiles/MethodDeclaration/MethodComments.cst

This file was deleted.

Loading