Skip to content

Commit 71b1f70

Browse files
committed
Update existing syntax tests
1 parent e6d844d commit 71b1f70

File tree

204 files changed

+1423
-1301
lines changed

Some content is hidden

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

204 files changed

+1423
-1301
lines changed

internal/compiler/tests/syntax/accessibility/accessible_properties.slint

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,41 @@
22
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
33

44
Button1 := Rectangle {
5-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
5+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
66
property <bool> cond;
77
accessible-role: cond ? button : AccessibleRole.text;
8-
// ^error{The `accessible-role` property must be a constant expression}
8+
// > <error{The `accessible-role` property must be a constant expression}
99

1010
rr := Rectangle {
1111
init => {
1212
self.accessible-role = AccessibleRole.text;
13-
// ^error{The property must be known at compile time and cannot be changed at runtime}
13+
// > <error{The property must be known at compile time and cannot be changed at runtime}
1414
}
1515
}
1616
}
1717

1818
Button2 := Rectangle {
19-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
19+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
2020
accessible-label: "the button";
21-
// ^error{The `accessible-label` property can only be set in combination to `accessible-role`}
21+
// > <error{The `accessible-label` property can only be set in combination to `accessible-role`}
2222
}
2323

2424
Button3 := Rectangle {
25-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
25+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
2626
Rectangle {
2727
accessible-role: text;
2828
accessible-label: "the button";
2929
}
3030
}
3131

3232
export Test := Window {
33-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
33+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
3434

3535
Button1 { }
3636
Button1 { accessible-description: "ok"; } // ok because Button1 has a role
3737
Button2 { accessible-role: none; }
3838
Button2 { }
3939
Button3 {}
4040
Button3 { accessible-description: "error";}
41-
// ^error{The `accessible-description` property can only be set in combination to `accessible-role`}
41+
// > <error{The `accessible-description` property can only be set in combination to `accessible-role`}
4242
}

internal/compiler/tests/syntax/analysis/binding_loop1.slint

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44

55
WithStates := Rectangle {
6-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
6+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
77
property <brush> extra_background;
88
property <bool> condition;
99
background: yellow; //FIXME: ideally we'd keep the span within the state
10-
// ^error{The binding for the property 'background' is part of a binding loop (extra-background -> background)}
10+
// > <error{The binding for the property 'background' is part of a binding loop (extra-background -> background)}
1111
states [
1212
xxx when condition : {
1313
background: extra_background;
@@ -16,32 +16,32 @@ WithStates := Rectangle {
1616
}
1717

1818
export Test := Rectangle {
19-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
19+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
2020

2121
property <int> a: 45 + root.b;
22-
// ^error{The binding for the property 'a' is part of a binding loop (root_window.d -> root_window.c -> root_window.b -> root_window.a)}
22+
// > <error{The binding for the property 'a' is part of a binding loop (root_window.d -> root_window.c -> root_window.b -> root_window.a)}
2323
property <float> b: root.c;
24-
// ^error{The binding for the property 'b' is part of a binding loop (root_window.d -> root_window.c -> root_window.b -> root_window.a)}
24+
// > <error{The binding for the property 'b' is part of a binding loop (root_window.d -> root_window.c -> root_window.b -> root_window.a)}
2525
property <int> c <=> d;
26-
// ^error{The binding for the property 'c' is part of a binding loop (root_window.d -> root_window.c -> root_window.b -> root_window.a)}
26+
// > <error{The binding for the property 'c' is part of a binding loop (root_window.d -> root_window.c -> root_window.b -> root_window.a)}
2727
property <int> d: root.a + root.e;
28-
// ^error{The binding for the property 'd' is part of a binding loop (root_window.d -> root_window.c -> root_window.b -> root_window.a)}
28+
// > <error{The binding for the property 'd' is part of a binding loop (root_window.d -> root_window.c -> root_window.b -> root_window.a)}
2929
property <int> e: root.b;
30-
// ^error{The binding for the property 'e' is part of a binding loop (root_window.e -> root_window.d -> root_window.c -> root_window.b)}
30+
// > <error{The binding for the property 'e' is part of a binding loop (root_window.e -> root_window.d -> root_window.c -> root_window.b)}
3131
property <int> w: root.a + root.b; // This id not part of a loop
3232

3333
property<bool> cond: xx.x == 0;
34-
// ^error{The binding for the property 'cond' is part of a binding loop (xx.y -> xx.x -> root_window.cond)}
34+
// > <error{The binding for the property 'cond' is part of a binding loop (xx.y -> xx.x -> root_window.cond)}
3535

3636
xx := Rectangle {
3737
x: y;
38-
// ^error{The binding for the property 'x' is part of a binding loop (xx.y -> xx.x -> root_window.cond)}
38+
// ><error{The binding for the property 'x' is part of a binding loop (xx.y -> xx.x -> root_window.cond)}
3939
y: root.cond ? 42px : 55px;
40-
// ^error{The binding for the property 'y' is part of a binding loop (xx.y -> xx.x -> root_window.cond)}
40+
// > <error{The binding for the property 'y' is part of a binding loop (xx.y -> xx.x -> root_window.cond)}
4141
}
4242

4343
WithStates {
4444
extra_background: background;
45-
// ^error{The binding for the property 'extra-background' is part of a binding loop (extra-background -> background)}
45+
// > <error{The binding for the property 'extra-background' is part of a binding loop (extra-background -> background)}
4646
}
4747
}

internal/compiler/tests/syntax/analysis/binding_loop2.slint

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,54 @@
33

44

55
T1 := Rectangle {
6-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
6+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
77
property <int> foo;
88
property <int> bar: foo;
9-
// ^error{The binding for the property 'bar' is part of a binding loop (foo -> bar)}
9+
// > <error{The binding for the property 'bar' is part of a binding loop (foo -> bar)}
1010
Text { text: bar; }
1111
}
1212

1313
T2 := Rectangle {
14-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
14+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
1515
property <string> t2_text;
1616
t:= Text { text: t2_text; }
17-
// ^error{The binding for the property 'text' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
18-
// ^^error{The binding for the property 'text' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
17+
// > <error{The binding for the property 'text' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
18+
// > <^error{The binding for the property 'text' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
1919
property t_alias <=> t.text;
20-
// ^error{The binding for the property 't-alias' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
21-
// ^^error{The binding for the property 't-alias' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
20+
// > <error{The binding for the property 't-alias' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
21+
// > <^error{The binding for the property 't-alias' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
2222
}
2323

2424
T3 := Rectangle {
25-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
25+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
2626
property <string> hello;
2727
property <string> al <=> a.t_alias;
28-
// ^error{The binding for the property 'al' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
28+
// > <error{The binding for the property 'al' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
2929
HorizontalLayout {
3030
a := T2 { t2_text: b.t_alias; }
31-
// ^error{The binding for the property 't2-text' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
31+
// > <error{The binding for the property 't2-text' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
3232
b := T2 { t2_text: root.hello; }
33-
// ^error{The binding for the property 't2-text' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
33+
// > <error{The binding for the property 't2-text' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
3434
}
3535
}
3636

3737
T4 := Rectangle {
38-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
38+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
3939
property <length> my_property <=> x;
4040
}
4141

4242
export App := Rectangle {
43-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
43+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
4444

4545

4646
VerticalLayout {
4747
T1 { foo: 44; }
4848
T1 { foo: bar; }
49-
// ^error{The binding for the property 'foo' is part of a binding loop (foo -> bar)}
49+
// > <error{The binding for the property 'foo' is part of a binding loop (foo -> bar)}
5050
T3 { hello: al; }
51-
// ^error{The binding for the property 'hello' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
51+
// > <error{The binding for the property 'hello' is part of a binding loop (hello -> b.t2-text -> t.text -> b.t-alias -> a.t2-text -> t.text -> a.t-alias -> al)}
5252

5353
T4 { my_property: my_property; }
54-
// ^error{Property 'my-property' cannot refer to itself}
54+
// > <error{Property 'my-property' cannot refer to itself}
5555
}
5656
}

internal/compiler/tests/syntax/analysis/binding_loop_function.slint

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,33 @@
22
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
33

44
Compo1 := Rectangle {
5-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
5+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
66

77
property <int> a : aa();
8-
// ^error{The binding for the property 'a' is part of a binding loop (cc.aa -> cc.a)}
8+
// > <error{The binding for the property 'a' is part of a binding loop (cc.aa -> cc.a)}
99
pure callback aa() -> int;
1010

1111
function factorial(n: int) -> int {
12-
// ^error{The binding for the property 'factorial' is part of a binding loop (cc.factorial)}
12+
// >error{The binding for the property 'factorial' is part of a binding loop (cc.factorial)}
1313
return n == 0 ? 1 : factorial(n - 1) * n;
1414
}
15+
// <error{The binding for the property 'factorial' is part of a binding loop (cc.factorial)}
1516

1617

1718
property <int> b;
1819
public pure function bb() -> int { return b; }
19-
// ^error{The binding for the property 'bb' is part of a binding loop (cc.bb -> cc.b)}
20+
// > <error{The binding for the property 'bb' is part of a binding loop (cc.bb -> cc.b)}
2021
}
2122

2223
export App := Rectangle {
23-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
24+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
2425
cc := Compo1 {
2526
aa() => { return self.a; }
26-
// ^error{The binding for the property 'aa' is part of a binding loop (cc.aa -> cc.a)}
27+
// >error{The binding for the property 'aa' is part of a binding loop (cc.aa -> cc.a)}
2728

2829
b: self.bb();
29-
// ^error{The binding for the property 'b' is part of a binding loop (cc.bb -> cc.b)}
30+
// <error{The binding for the property 'aa' is part of a binding loop (cc.aa -> cc.a)}
31+
// > <^error{The binding for the property 'b' is part of a binding loop (cc.bb -> cc.b)}
3032
}
3133

3234

internal/compiler/tests/syntax/analysis/binding_loop_issue_772.slint

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
33

44
Alias := Rectangle {
5-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
5+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
66
property <int> viewport_width ;
77
property <int> ps_width <=> viewport_width;
88
}
99

1010
export Foo := Rectangle {
11-
// ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
11+
// ><warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info}
1212
property <int> base-prop: alias.viewport_width;
13-
// ^error{The binding for the property 'base-prop' is part of a binding loop (alias.ps-width -> root_window.base-prop)}
13+
// > <error{The binding for the property 'base-prop' is part of a binding loop (alias.ps-width -> root_window.base-prop)}
1414

1515
alias := Alias { ps_width: base-prop; }
16-
// ^error{The binding for the property 'ps-width' is part of a binding loop (alias.ps-width -> root_window.base-prop)}
16+
// > <error{The binding for the property 'ps-width' is part of a binding loop (alias.ps-width -> root_window.base-prop)}
1717

1818
Text {
1919
text: base-prop;

0 commit comments

Comments
 (0)