Skip to content

Commit db1bc06

Browse files
authored
Update test ProjectBuilder default Cairo edition to 2024_07 (#2025)
commit-id:7e728476 Fix test fixtures after edition change --- **Stack**: - #2028 - #2027 - #2025⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do not merge manually using the UI - doing so may have unexpected results.*
1 parent 36a997a commit db1bc06

17 files changed

+75
-627
lines changed

extensions/scarb-cairo-test/tests/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ fn integration_tests() {
210210
ProjectBuilder::start()
211211
.name("hello")
212212
.lib_cairo(formatdoc! {r#"
213-
fn fib(mut n: u32) -> u32 {{
213+
pub fn fib(mut n: u32) -> u32 {{
214214
let mut a: u32 = 0;
215215
let mut b: u32 = 1;
216216
while n != 0 {{
@@ -339,7 +339,7 @@ fn can_choose_test_kind_to_run() {
339339
ProjectBuilder::start()
340340
.name("hello")
341341
.lib_cairo(formatdoc! {r#"
342-
fn fib(mut n: u32) -> u32 {{
342+
pub fn fib(mut n: u32) -> u32 {{
343343
let mut a: u32 = 0;
344344
let mut b: u32 = 1;
345345
while n != 0 {{

extensions/scarb-doc/tests/data/json_output_test_data.json

+8-263
Original file line numberDiff line numberDiff line change
@@ -10,270 +10,15 @@
1010
"signature": null,
1111
"full_path": "hello_world"
1212
},
13-
"submodules": [
14-
{
15-
"item_data": {
16-
"name": "tests",
17-
"doc": "Tests module",
18-
"signature": null,
19-
"full_path": "hello_world::tests"
20-
},
21-
"submodules": [],
22-
"constants": [],
23-
"free_functions": [
24-
{
25-
"item_data": {
26-
"name": "it_works",
27-
"doc": "Really works.",
28-
"signature": "fn it_works()",
29-
"full_path": "hello_world::tests::it_works"
30-
}
31-
}
32-
],
33-
"structs": [],
34-
"enums": [],
35-
"type_aliases": [],
36-
"impl_aliases": [],
37-
"traits": [],
38-
"impls": [],
39-
"extern_types": [],
40-
"extern_functions": []
41-
}
42-
],
43-
"constants": [
44-
{
45-
"item_data": {
46-
"name": "FOO",
47-
"doc": "FOO constant with value 42",
48-
"signature": "const FOO: u32 = 42;",
49-
"full_path": "hello_world::FOO"
50-
}
51-
}
52-
],
53-
"free_functions": [
54-
{
55-
"item_data": {
56-
"name": "main",
57-
"doc": "Main function that calculates the 16th Fibonacci number",
58-
"signature": "fn main() -> u32",
59-
"full_path": "hello_world::main"
60-
}
61-
},
62-
{
63-
"item_data": {
64-
"name": "fib",
65-
"doc": "Calculate the nth Fibonacci number # Arguments * `n` - The index of the Fibonacci number to calculate",
66-
"signature": "fn fib(mut n: u32) -> u32",
67-
"full_path": "hello_world::fib"
68-
}
69-
}
70-
],
71-
"structs": [
72-
{
73-
"members": [
74-
{
75-
"item_data": {
76-
"name": "radius",
77-
"doc": "Radius of the circle",
78-
"signature": "radius: u32",
79-
"full_path": "hello_world::Circle::radius"
80-
}
81-
}
82-
],
83-
"item_data": {
84-
"name": "Circle",
85-
"doc": "Circle struct with radius field",
86-
"signature": "#[derive(Drop, Serde, PartialEq)]\nstruct Circle {\n radius: u32,\n}",
87-
"full_path": "hello_world::Circle"
88-
}
89-
}
90-
],
91-
"enums": [
92-
{
93-
"variants": [
94-
{
95-
"item_data": {
96-
"name": "Red",
97-
"doc": "Red color",
98-
"signature": "Red : ( )",
99-
"full_path": "hello_world::Color::Red"
100-
}
101-
},
102-
{
103-
"item_data": {
104-
"name": "Green",
105-
"doc": "Green color",
106-
"signature": "Green : ( )",
107-
"full_path": "hello_world::Color::Green"
108-
}
109-
},
110-
{
111-
"item_data": {
112-
"name": "Blue",
113-
"doc": "Blue color",
114-
"signature": "Blue : ( )",
115-
"full_path": "hello_world::Color::Blue"
116-
}
117-
}
118-
],
119-
"item_data": {
120-
"name": "Color",
121-
"doc": "Color enum with Red, Green, and Blue variants",
122-
"signature": "enum Color {\n Red: (),\n Green: (),\n Blue: (),\n}",
123-
"full_path": "hello_world::Color"
124-
}
125-
}
126-
],
127-
"type_aliases": [
128-
{
129-
"item_data": {
130-
"name": "Pair",
131-
"doc": "Pair type alias for a tuple of two u32 values",
132-
"signature": "type Pair = (u32, u32);",
133-
"full_path": "hello_world::Pair"
134-
}
135-
}
136-
],
13+
"submodules": [],
14+
"constants": [],
15+
"free_functions": [],
16+
"structs": [],
17+
"enums": [],
18+
"type_aliases": [],
13719
"impl_aliases": [],
138-
"traits": [
139-
{
140-
"trait_constants": [
141-
{
142-
"item_data": {
143-
"name": "SHAPE_CONST",
144-
"doc": "Constant for the shape type",
145-
"signature": "const SHAPE_CONST: felt252;",
146-
"full_path": "hello_world::Shape::SHAPE_CONST"
147-
}
148-
}
149-
],
150-
"trait_types": [
151-
{
152-
"item_data": {
153-
"name": "ShapePair",
154-
"doc": "Type alias for a pair of shapes",
155-
"signature": "type ShapePair;",
156-
"full_path": "hello_world::Shape::ShapePair"
157-
}
158-
}
159-
],
160-
"trait_functions": [
161-
{
162-
"item_data": {
163-
"name": "area",
164-
"doc": "Calculate the area of the shape",
165-
"signature": "fn area(self: T) -> u32",
166-
"full_path": "hello_world::Shape::area"
167-
}
168-
}
169-
],
170-
"item_data": {
171-
"name": "Shape",
172-
"doc": "Shape trait for objects that have an area",
173-
"signature": "trait Shape<T>",
174-
"full_path": "hello_world::Shape"
175-
}
176-
}
177-
],
178-
"impls": [
179-
{
180-
"impl_types": [
181-
{
182-
"item_data": {
183-
"name": "ShapePair",
184-
"doc": "Type alias for a pair of circles",
185-
"signature": "type ShapePair = (Circle, Circle);",
186-
"full_path": "hello_world::CircleShape::ShapePair"
187-
}
188-
}
189-
],
190-
"impl_constants": [
191-
{
192-
"item_data": {
193-
"name": "SHAPE_CONST",
194-
"doc": "Shape constant",
195-
"signature": "const SHAPE_CONST: felt252 = 'xyz';",
196-
"full_path": "hello_world::CircleShape::SHAPE_CONST"
197-
}
198-
}
199-
],
200-
"impl_functions": [
201-
{
202-
"item_data": {
203-
"name": "area",
204-
"doc": "Implementation of the area method for Circle",
205-
"signature": "fn area(self: Circle) -> u32",
206-
"full_path": "hello_world::CircleShape::area"
207-
}
208-
}
209-
],
210-
"item_data": {
211-
"name": "CircleShape",
212-
"doc": "Implementation of the Shape trait for Circle",
213-
"signature": "impl CircleShape of Shape<Circle>",
214-
"full_path": "hello_world::CircleShape"
215-
}
216-
},
217-
{
218-
"impl_types": [],
219-
"impl_constants": [],
220-
"impl_functions": [],
221-
"item_data": {
222-
"name": "CircleDrop",
223-
"doc": null,
224-
"signature": "impl CircleDrop of core::traits::Drop<Circle>;",
225-
"full_path": "hello_world::CircleDrop"
226-
}
227-
},
228-
{
229-
"impl_types": [],
230-
"impl_constants": [],
231-
"impl_functions": [
232-
{
233-
"item_data": {
234-
"name": "serialize",
235-
"doc": null,
236-
"signature": "fn serialize(self: @Circle, ref output: core::array::Array<felt252>)",
237-
"full_path": "hello_world::CircleSerde::serialize"
238-
}
239-
},
240-
{
241-
"item_data": {
242-
"name": "deserialize",
243-
"doc": null,
244-
"signature": "fn deserialize(ref serialized: core::array::Span<felt252>) -> core::option::Option<Circle>",
245-
"full_path": "hello_world::CircleSerde::deserialize"
246-
}
247-
}
248-
],
249-
"item_data": {
250-
"name": "CircleSerde",
251-
"doc": null,
252-
"signature": "impl CircleSerde of core::serde::Serde<Circle>",
253-
"full_path": "hello_world::CircleSerde"
254-
}
255-
},
256-
{
257-
"impl_types": [],
258-
"impl_constants": [],
259-
"impl_functions": [
260-
{
261-
"item_data": {
262-
"name": "eq",
263-
"doc": null,
264-
"signature": "fn eq(lhs: @Circle, rhs: @Circle) -> bool",
265-
"full_path": "hello_world::CirclePartialEq::eq"
266-
}
267-
}
268-
],
269-
"item_data": {
270-
"name": "CirclePartialEq",
271-
"doc": null,
272-
"signature": "impl CirclePartialEq of core::traits::PartialEq<Circle>",
273-
"full_path": "hello_world::CirclePartialEq"
274-
}
275-
}
276-
],
20+
"traits": [],
21+
"impls": [],
27722
"extern_types": [],
27823
"extern_functions": []
27924
}

0 commit comments

Comments
 (0)