Skip to content

Commit 1b11abf

Browse files
authored
Merge pull request #709 from hvitved/csharp/autoformat/tests
C#: Autoformat QL tests
2 parents 5478155 + af38a2b commit 1b11abf

File tree

484 files changed

+2746
-2181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

484 files changed

+2746
-2181
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import csharp
22

33
from Expr e, int m
4-
where expr_argument(e,m)
4+
where expr_argument(e, m)
55
select e, m

csharp/ql/test/library-tests/asp/basic/AspDirective.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ import semmle.code.asp.AspNet
33
from AspDirective directive, string name, AspAttribute attrib
44
where directive.getAttributeByName(name) = attrib
55
select directive, name, attrib
6-

csharp/ql/test/library-tests/asp/basic/AspOpenTag.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ import semmle.code.asp.AspNet
33
from AspOpenTag tag, string name, AspAttribute attrib
44
where tag.getAttributeByName(name) = attrib
55
select tag, name, attrib
6-
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import semmle.code.asp.AspNet
22

33
from AspComment comment, string kind
4-
where
5-
if comment instanceof AspServerComment
6-
then kind = "server"
7-
else kind = "client"
4+
where if comment instanceof AspServerComment then kind = "server" else kind = "client"
85
select comment, comment.getBody(), kind

csharp/ql/test/library-tests/asp/parseError/AspDirective.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ import semmle.code.asp.AspNet
33
from AspDirective directive, string name, AspAttribute attrib
44
where directive.getAttributeByName(name) = attrib
55
select directive, name, attrib
6-

csharp/ql/test/library-tests/asp/parseError/AspOpenTag.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ import semmle.code.asp.AspNet
33
from AspOpenTag tag, string name, AspAttribute attrib
44
where tag.getAttributeByName(name) = attrib
55
select tag, name, attrib
6-
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import semmle.code.asp.AspNet
22

33
from AspComment comment, string kind
4-
where
5-
if comment instanceof AspServerComment
6-
then kind = "server"
7-
else kind = "client"
4+
where if comment instanceof AspServerComment then kind = "server" else kind = "client"
85
select comment, comment.getBody(), kind

csharp/ql/test/library-tests/assemblies/CompareVersions.ql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import csharp
22

3-
Version getAVersion()
4-
{
3+
Version getAVersion() {
54
result = "1.2" or
65
result = "1.2.0" or
76
result = "1.2.0.0" or
@@ -15,6 +14,7 @@ Version getAVersion()
1514
}
1615

1716
from Version v1, Version v2
18-
where v1 = getAVersion()
19-
and v2 = getAVersion()
17+
where
18+
v1 = getAVersion() and
19+
v2 = getAVersion()
2020
select v1, v2, v1.compareTo(v2)
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import csharp
22

33
from Version version
4-
where version = "1.2.3.4"
5-
or version = "2.3.24"
6-
or version = "1.2"
7-
or version = "xxx"
8-
or version = "1.x"
9-
or version = "1"
10-
or version = ""
11-
or version = "1234.56"
12-
select version, version.getMajor(), version.getMajorRevision(), version.getMinor(), version.getMinorRevision()
4+
where
5+
version = "1.2.3.4" or
6+
version = "2.3.24" or
7+
version = "1.2" or
8+
version = "xxx" or
9+
version = "1.x" or
10+
version = "1" or
11+
version = "" or
12+
version = "1234.56"
13+
select version, version.getMajor(), version.getMajorRevision(), version.getMinor(),
14+
version.getMinorRevision()

csharp/ql/test/library-tests/assemblies/assemblies.ql

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,18 @@
11
import csharp
22

3-
class TypeRef extends @typeref
4-
{
5-
string toString() {
6-
hasName(result)
7-
}
3+
class TypeRef extends @typeref {
4+
string toString() { hasName(result) }
85

9-
predicate hasName(string name) {
10-
typerefs(this, name)
11-
}
6+
predicate hasName(string name) { typerefs(this, name) }
127

13-
Type getType() {
14-
typeref_type(this, result)
15-
}
8+
Type getType() { typeref_type(this, result) }
169
}
1710

18-
class MissingType extends TypeRef
19-
{
20-
MissingType() {
21-
not exists(getType())
22-
}
23-
}
11+
class MissingType extends TypeRef { MissingType() { not exists(getType()) } }
2412

2513
from
26-
Class class1,
27-
MissingType class2,
28-
MissingType class3,
29-
MissingType class4,
30-
MissingType class5,
31-
MissingType del2,
32-
Field a,
33-
Method b,
34-
Method c,
35-
Method d,
36-
Method e,
37-
Method f,
38-
Method g
14+
Class class1, MissingType class2, MissingType class3, MissingType class4, MissingType class5,
15+
MissingType del2, Field a, Method b, Method c, Method d, Method e, Method f, Method g
3916
where
4017
class1.hasQualifiedName("Assembly1.Class1") and
4118
class2.hasName("Class2") and
@@ -50,10 +27,10 @@ where
5027
e.hasName("e") and
5128
f.hasName("f") and
5229
g.hasName("g") and
53-
a.getDeclaringType()=class1 and
54-
a.getDeclaringType()=class1 and
55-
b.getDeclaringType()=class1 and
56-
c.getDeclaringType()=class1 and
30+
a.getDeclaringType() = class1 and
31+
a.getDeclaringType() = class1 and
32+
b.getDeclaringType() = class1 and
33+
c.getDeclaringType() = class1 and
5734
not exists(c.getParameter(0).getType()) and
5835
not exists(a.getType()) and
5936
not exists(b.getReturnType()) and

0 commit comments

Comments
 (0)