Skip to content

Commit 9c4c354

Browse files
PeterCardenaslewis6991
authored andcommitted
test: move snapshot tests to test/snapshots
1 parent 93b29a3 commit 9c4c354

File tree

6 files changed

+518
-6
lines changed

6 files changed

+518
-6
lines changed

test/snapshots/snapshot.cpp

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
struct Struct {
2+
int *f1;
3+
int *f2;
4+
5+
6+
7+
// cursor position 1
8+
};
9+
10+
11+
12+
13+
14+
15+
16+
17+
class Class {
18+
int *f1;
19+
int *f2;
20+
21+
22+
23+
// cursor position 2
24+
};
25+
26+
27+
28+
29+
30+
31+
32+
33+
typedef enum {
34+
E1,
35+
E2,
36+
E3
37+
38+
39+
// cursor position 3
40+
} myenum;
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
int main(int arg1,
52+
char **arg2,
53+
char **arg3
54+
)
55+
{
56+
if (arg1 == 4
57+
&& arg2 == arg3) {
58+
for (int i = 0; i < arg1; i++) {
59+
while (1) {
60+
61+
62+
63+
64+
65+
// cursor position 4
66+
}
67+
}
68+
}
69+
70+
71+
72+
73+
74+
75+
do {
76+
int array[1];
77+
for (auto value : array) {
78+
79+
80+
81+
82+
83+
// cursor position 5
84+
}
85+
} while (1);
86+
}

test/snapshots/snapshot.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
```html
2+
<html>
3+
<body>
4+
5+
6+
7+
8+
9+
10+
<script>
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
function test() {
24+
if test != "" {
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
}
41+
}
42+
</script>
43+
</body>
44+
</html>
45+
```
46+
47+
# Title
48+
49+
50+
51+
52+
53+
Test
54+
55+
56+
57+
58+
59+
60+
61+
62+
63+
64+

test/snapshots/snapshot.php

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?php
2+
/*
3+
* comment
4+
*/
5+
#[ReturnTypeWillChange]
6+
function foo($a, $b) {
7+
//loop, between low & high
8+
while ($a <= $b) {
9+
// comment
10+
$index = $low + floor(($high - $low) * $delta);
11+
// comment
12+
$indexValue = $a;
13+
if ($indexValue === $a) {
14+
// comment
15+
16+
17+
$position = $index;
18+
return (int) $position;
19+
}
20+
if ($indexValue < $key) {
21+
// comment
22+
23+
$low = $index + 1;
24+
}
25+
if ($indexValue > $key) {
26+
// comment
27+
do {
28+
// comment
29+
echo "The number is: $x <br>";
30+
$x++;
31+
32+
33+
34+
35+
} while ($x <= 5);
36+
37+
for ($x = 0; $x <= 10; $x++) {
38+
echo "The number is: $x <br>";
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
}
51+
52+
53+
54+
foreach ($colors as $value) {
55+
echo "$value <br>";
56+
57+
58+
59+
60+
61+
62+
}
63+
64+
$high = $index - 1;
65+
}
66+
}
67+
68+
69+
70+
//when key not found in array or array not sorted
71+
return null;
72+
}
73+
74+
#[Attribute]
75+
class Fruit {
76+
77+
78+
79+
80+
#[ReturnTypeWillChange]
81+
public function rot(): void
82+
{
83+
84+
85+
return;
86+
}
87+
88+
89+
90+
// comment
91+
92+
93+
94+
95+
}

0 commit comments

Comments
 (0)