tests: fixture 파일명과 unit 동기화

This commit is contained in:
2026-08-17 04:14:30 +09:00
parent fe5f853feb
commit d22964cdb6
119 changed files with 286 additions and 119 deletions
@@ -1,5 +1,5 @@
// ERROR:13:catch
unit badcatch;
unit badcatc;
error E {
Bad = 1,
@@ -15,3 +15,4 @@ fn bad() -> i32 {
};
return v;
}
@@ -1,5 +1,5 @@
// ERROR:13:type
unit baddef;
unit baddefi;
error E {
Bad = 1,
@@ -12,3 +12,5 @@ fn leaf() -> E!i32 {
fn bad() -> i32 {
return leaf() catch false;
}
@@ -1,7 +1,8 @@
// ERROR:6:duplicate
unit badercod;
unit badecod;
error E {
One = 1,
Two = 1,
}
@@ -1,7 +1,8 @@
// ERROR:6:duplicate
unit badernam;
unit badenam;
error E {
One = 1,
One = 2,
}
@@ -1,5 +1,5 @@
// ERROR:17:error
unit badetype;
unit badetyp;
error A {
Bad = 1,
@@ -16,3 +16,5 @@ fn leaf() -> A!i32 {
fn bad() -> B!i32 {
return try leaf();
}
@@ -1,5 +1,5 @@
// ERROR:9:optional
unit baddir;
unit badidir;
struct Node {
value: i32,
@@ -8,3 +8,4 @@ struct Node {
fn bad(p: ?^Node) -> i32 {
return p.^.value;
}
@@ -1,6 +1,8 @@
// ERROR:5:null
unit badnull;
unit badnullv;
fn bad() -> void {
let p = null;
}
@@ -1,6 +1,8 @@
// ERROR:5:reference
unit badoref;
unit badorefv;
struct Bad {
value: ?&i32,
}
@@ -1,5 +1,5 @@
// ERROR:9:non-Copy
unit badorel;
unit badorlx;
struct Node {
next: ?^Node,
@@ -8,3 +8,5 @@ struct Node {
fn bad(p: ^Node, fallback: ^Node) -> ^Node {
return p.next orelse fallback;
}
@@ -1,5 +1,5 @@
// ERROR:9:mem.replace
unit badproj;
unit badprjv;
struct Node {
next: ?^Node,
@@ -9,3 +9,5 @@ fn bad(p: ^Node) -> void {
let q = p.next;
mem.destroy(p);
}
@@ -1,7 +1,9 @@
// ERROR:6:optional
unit badqmark;
unit badqmkv;
fn bad() -> i32 {
let x: i32 = 1;
return x.?;
}
@@ -1,5 +1,5 @@
// ERROR:13:error
unit badret;
unit badrett;
error A {
Bad = 1,
@@ -12,3 +12,4 @@ error B {
fn bad() -> B!i32 {
return A.Bad;
}
@@ -1,7 +1,9 @@
// ERROR:5:Some
unit badsome;
unit badsomev;
fn bad() -> i32 {
let x = Some(1);
return x;
}
@@ -1,5 +1,5 @@
// ERROR:13:try
unit badtry;
unit badtryx;
error E {
Bad = 1,
@@ -12,3 +12,5 @@ fn leaf() -> E!i32 {
fn bad() -> i32 {
return try leaf();
}
@@ -1,6 +1,8 @@
// ERROR:5:0
unit badzero;
unit badzero1;
error E {
Zero = 0,
}
@@ -1,4 +1,4 @@
unit okcatch;
unit okcatc;
error E {
Bad = 1,
@@ -14,3 +14,4 @@ fn top() -> E!i32 {
};
return v;
}
@@ -1,4 +1,4 @@
unit okcatmov;
unit okcatmv;
error E { Bad = 1, }
struct Node { value: i32, }
@@ -6,3 +6,4 @@ struct Node { value: i32, }
fn recover(result: E!^Node, fallback: ^Node) -> ^Node {
return result catch fallback;
}
@@ -1,4 +1,4 @@
unit okcvoid;
unit okcvd;
error E {
Bad = 1,
@@ -13,3 +13,4 @@ fn top() -> void {
return;
};
}
@@ -1,4 +1,4 @@
unit okdeflt;
unit okdefl;
error E {
Bad = 1,
@@ -11,3 +11,4 @@ fn leaf() -> E!i32 {
fn top() -> i32 {
return leaf() catch 11;
}
@@ -1,4 +1,4 @@
unit okiflet;
unit okiflt;
fn value(p: ?i32) -> i32 {
if let Some(v) = p {
@@ -6,3 +6,5 @@ fn value(p: ?i32) -> i32 {
}
return 0;
}
@@ -1,4 +1,4 @@
unit okmatch;
unit okmtch;
fn value(p: ?i32) -> i32 {
match p {
@@ -6,3 +6,5 @@ fn value(p: ?i32) -> i32 {
None => { return 0; }
}
}
@@ -1,4 +1,4 @@
unit oknull;
unit oknull1;
struct Node { value: i32, }
@@ -8,3 +8,5 @@ fn test() -> bool {
let p: ?^Node = null;
return accepts(p);
}
@@ -1,5 +1,6 @@
unit okorelse;
unit okorel;
fn value(p: ?i32) -> i32 {
return p orelse 9;
}
@@ -1,4 +1,4 @@
unit okproj;
unit okproj1;
struct Node {
value: i32,
@@ -7,3 +7,5 @@ struct Node {
fn touch(p: ?&mut Node) -> void {
p.?.value = 7;
}
@@ -1,4 +1,4 @@
unit okpatvw;
unit okptvw;
struct Node { value: i32, }
@@ -10,3 +10,5 @@ fn keep(p: ?^Node) -> void {
let owned = mem.replace(&mut slot, null).?;
mem.destroy(owned);
}
@@ -1,4 +1,4 @@
unit okrepl;
unit okrepl2;
struct Node {
value: i32,
@@ -9,3 +9,5 @@ fn take(p: ?^Node) -> void {
let n = mem.replace(&mut q, null).?;
mem.destroy(n);
}
@@ -1,4 +1,4 @@
unit oktrdef;
unit oktrd2;
error E {
Bad = 1,
@@ -12,3 +12,5 @@ fn top() -> E!i32 {
defer { let x: i32 = 1; }
return try leaf();
}
@@ -1,4 +1,4 @@
unit oktry;
unit oktry2;
error E {
Bad = 1,
@@ -12,3 +12,5 @@ fn leaf(ok: bool) -> E!i32 {
fn top() -> E!i32 {
return try leaf(true);
}