forked from hhvm/hack-codegen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodegenFileTestCase.codegen
More file actions
107 lines (89 loc) · 2.04 KB
/
CodegenFileTestCase.codegen
File metadata and controls
107 lines (89 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
@generated
!@#$%codegentest:testAutogenerated
<?hh
// Codegen Tests
/**
* This file is generated. Do not modify it manually!
*
* Completely autogenerated!
*
* @-generated SignedSource<<38687075d6c73650c6f1db0ddc0289b1>>
*/
class AllAutogenerated {
public function getName(): string {
return $this->name;
}
}
!@#$%codegentest:testGenerateTopLevelFunctions
<?hh
// Codegen Tests
/**
* This file is generated. Do not modify it manually!
*
* @-generated SignedSource<<9c01c32f3726d3bdfce9081f6d2f960d>>
*/
function fun(): int {
return 0;
}
!@#$%codegentest:testNoSignature
<?hh
// Codegen Tests
class NoSignature {
public function getName(): string {
return $this->name;
}
}
!@#$%codegentest:testPartiallyGenerated
<?hh
// Codegen Tests
/**
* This file is partially generated. Only make modifications between BEGIN
* MANUAL SECTION and END MANUAL SECTION designators.
*
* @-partially-generated SignedSource<<ad278c9e79767412d83e1b38ff2941f7>>
*/
class PartiallyGenerated {
public function getSomething() {
/* BEGIN MANUAL SECTION PartiallyGenerated::getSomething */
throw new ViolationException('Unimplemented');
/* END MANUAL SECTION */
}
}
/**
* We can put many clases in one file!
*/
class PartiallyGeneratedLoader {
}
!@#$%codegentest:testSaveAutogenerated
<?hh
// Codegen Tests
/**
* This file is generated. Do not modify it manually!
*
* Testing CodegenFile with autogenerated files
*
* @-generated SignedSource<<0106cc680ba25012292b6e0926bd6d6c>>
*/
class Demo {
public function getName() {
return "Codegen";
}
}
!@#$%codegentest:testSavePartiallyGenerated
<?hh
// Codegen Tests
/**
* This file is partially generated. Only make modifications between BEGIN
* MANUAL SECTION and END MANUAL SECTION designators.
*
* Testing CodegenFile with partially generated files
*
* @-partially-generated SignedSource<<b3830b620725abe75fcd90041759d03a>>
*/
class Demo {
public function getName() {
/* BEGIN MANUAL SECTION Demo::getName */
// manual_section_here
/* END MANUAL SECTION */
}
}