Skip to content

Commit

Permalink
Test names clashing
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasLYang committed Feb 7, 2025
1 parent b5e5c51 commit fc47970
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/turborepo-lib/src/turbo_json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ mod tests {
turbo_json::RawTaskDefinition,
};

#[test_case("{}", "empty")]
#[test_case("{}", "empty boundaries")]
#[test_case(r#"{"tags": {} }"#, "empty tags")]
#[test_case(
r#"{"tags": { "my-tag": { "dependencies": { "allow": ["my-package"] } } } }"#,
Expand Down Expand Up @@ -828,7 +828,7 @@ mod tests {
"{}",
RawTaskDefinition::default(),
TaskDefinition::default()
; "empty")]
; "empty task definition")]
#[test_case(
r#"{ "persistent": false }"#,
RawTaskDefinition {
Expand Down Expand Up @@ -1045,7 +1045,7 @@ mod tests {
assert_eq!(actual, expected);
}

#[test_case(r#"{ "tags": [] }"#, "empty")]
#[test_case(r#"{ "tags": [] }"#, "empty tags in package")]
#[test_case(r#"{ "tags": ["my-tag"] }"#, "one tag")]
#[test_case(r#"{ "tags": ["my-tag", "my-other-tag"] }"#, "two tags")]
fn test_tags(json: &str, name: &str) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
source: crates/turborepo-lib/src/turbo_json/mod.rs
expression: json.tags
expression: raw_task_definition
---
[]
{
"tags": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
source: crates/turborepo-lib/src/turbo_json/mod.rs
expression: raw_task_definition
---
{
"tags": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
source: crates/turborepo-lib/src/turbo_json/mod.rs
expression: json.tags
---
[]
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/bad-turbo-json.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Run build with package task in non-root turbo.json
unnecessary-package-task-syntax)

x "my-app#build". Use "build" instead.
,-(apps/my-app/turbo.json:8:21)
,-\(apps(\/|\\)my-app(\/|\\)turbo.json:8:21\) (re)
7 | // this comment verifies that turbo can read .json files
with comments
8 | ,-> "my-app#build": {
Expand Down

0 comments on commit fc47970

Please sign in to comment.