makepad/libs/relax/compiler/tests/primitive_module_paths.rs
Admin b22a714840 makepad run: the Rust JIT (libs/relax) and makepad-remote
The JIT that runs makepad apps from source: lexer, front end, type checker,
lazy borrow checker (Gandalf; `--check-first` opts in), codegen, session and
warm/cold caches keyed by compiler stamp, provided crates bound late,
startup images, live patching. User-facing name is `makepad run` (binary
`makepad`, MAKEPAD_RUN_* env, ~/.makepad-run); libs/relax stays the internal
library name. `makepad check` reports rustc-style diagnostics with rustc
error codes and checks a whole workspace (`--workspace`). Runs on macOS,
Linux, Windows and Android. makepad-remote: one tool schema for apps and the
WM (app/1): grabs, captures, traces, frame profiles and tweaks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 12:26:21 +02:00

38 lines
1.1 KiB
Rust

#[test]
fn primitive_module_paths() {
let s = "ab\0c";
assert!(::core::iter::Iterator::any(&mut ::core::primitive::str::bytes(s), |b| b == b'\0'));
assert_eq!(::core::primitive::str::len("abc"), 3);
assert_eq!(core::primitive::u32::max(3, 5), 5);
assert_eq!(<core::primitive::u8>::MAX, 255);
let x: core::primitive::usize = 4;
assert_eq!(x, 4);
}
#[test]
fn std_primitive_module_paths() {
assert_eq!(::std::primitive::str::len("abc"), 3);
assert_eq!(std::primitive::u32::max(3, 5), 5);
assert_eq!(<std::primitive::u8>::MAX, 255);
let x: std::primitive::usize = 4;
assert_eq!(x, 4);
}
mod reexports {
pub use str as Text;
pub use u32 as Number;
pub use u8 as Byte;
pub mod nested {
pub use super::{Byte, Number, Text};
}
}
#[test]
fn renamed_primitive_paths() {
assert_eq!(reexports::nested::Text::bytes("abc").next(), Some(b'a'));
assert_eq!(reexports::nested::Number::max(3, 5), 5);
assert_eq!(reexports::nested::Byte::MAX, 255);
let x: reexports::nested::Number = 4;
assert_eq!(x, 4);
}