2024-01-03 03:22:36 +00:00
|
|
|
// Licensed under the Apache License, Version 2.0 or the MIT License.
|
|
|
|
// Copyright (C) 2023-2024 Ant Group.
|
|
|
|
|
2023-03-03 02:14:27 +00:00
|
|
|
//! This test checks that if cargo-component can control method and trait method
|
|
|
|
|
|
|
|
#![feature(once_cell)]
|
|
|
|
|
|
|
|
mod test_utils;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn trait_method() {
|
2023-03-08 07:42:21 +00:00
|
|
|
let stderr = run_cargo_component_cmd!();
|
2023-03-03 02:14:27 +00:00
|
|
|
assert!(stderr.contains("access controlled entry point is disallowed"));
|
2024-02-21 08:58:40 +00:00
|
|
|
assert!(stderr.contains("access foo2::Foo::method in bar2"));
|
|
|
|
assert!(stderr.contains("access foo2::FooTrait::trait_associate_fn in bar2"));
|
|
|
|
assert!(stderr.contains("access foo2::FooTrait::trait_method in bar2"));
|
2023-03-03 02:14:27 +00:00
|
|
|
}
|