Skip to content

Commit

Permalink
Rename test plugin to cairo_test (#1358)
Browse files Browse the repository at this point in the history
commit-id:d90b1698

---

**Stack**:
- #1362
- #1359
- #1358⚠️ *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.*
  • Loading branch information
maciektr authored Jun 14, 2024
1 parent c3cefdd commit fd505ca
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 112 deletions.
2 changes: 1 addition & 1 deletion scarb/scarblib/test_plugin/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "test_plugin"
name = "cairo_test"
version = "{{ CAIRO_VERSION }}"

no-core = true
Expand Down
5 changes: 3 additions & 2 deletions scarb/src/core/package/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::internal::restricted_names;

#[cfg(doc)]
use crate::core::Package;
use crate::{STARKNET_PLUGIN_NAME, TEST_PLUGIN_NAME};

/// A [`String`]-like type representing [`Package`] name.
///
Expand All @@ -28,8 +29,8 @@ pub struct PackageName(SmolStr);

impl PackageName {
pub const CORE: Self = PackageName(SmolStr::new_inline(CORELIB_CRATE_NAME));
pub const STARKNET: Self = PackageName(SmolStr::new_inline("starknet"));
pub const TEST_PLUGIN: Self = PackageName(SmolStr::new_inline("test_plugin"));
pub const STARKNET: Self = PackageName(SmolStr::new_inline(STARKNET_PLUGIN_NAME));
pub const TEST_PLUGIN: Self = PackageName(SmolStr::new_inline(TEST_PLUGIN_NAME));

/// Constructs and validates new [`PackageName`].
///
Expand Down
6 changes: 3 additions & 3 deletions scarb/src/internal/restricted_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::path::Path;

use crate::DEFAULT_TESTS_PATH;
use crate::{DEFAULT_TESTS_PATH, STARKNET_PLUGIN_NAME, TEST_PLUGIN_NAME};
use cairo_lang_filesystem::db::CORELIB_CRATE_NAME;

/// Checks if name is a Cairo keyword
Expand Down Expand Up @@ -80,8 +80,8 @@ pub fn is_internal(name: &str) -> bool {
[
CORELIB_CRATE_NAME,
DEFAULT_TESTS_PATH,
"test_plugin",
"starknet",
STARKNET_PLUGIN_NAME,
TEST_PLUGIN_NAME,
]
.contains(&name)
}
2 changes: 2 additions & 0 deletions scarb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ pub static DEFAULT_SOURCE_PATH: Lazy<Utf8PathBuf> =
Lazy::new(|| ["src", "lib.cairo"].iter().collect());
pub const DEFAULT_README_FILE_NAME: &str = "README.md";
pub const DEFAULT_LICENSE_FILE_NAME: &str = "LICENSE";
pub const STARKNET_PLUGIN_NAME: &str = "starknet";
pub const TEST_PLUGIN_NAME: &str = "cairo_test";
Loading

0 comments on commit fd505ca

Please sign in to comment.