aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2020-11-01 19:42:53 -0800
committerChih-Hung Hsieh <chh@google.com>2020-11-02 21:49:06 -0800
commitece47a2b47a15d4d23b394f513be4e93e2a617ec (patch)
treeb96c7e09d28efaaf8e5527dd44bfd7d0736ea84e
parent44526bd183933881e036ccf1f2c8751a0a56c406 (diff)
downloadpaste-ece47a2b47a15d4d23b394f513be4e93e2a617ec.tar.gz
Replace env!("...") expressions
* Use new regen_bp.sh to find/fix env!("...") expressions * No need of local diff file or post_update.sh because regen_bp.sh will fix any old/new env!("...") expressions. Bug: 172299943 Test: build all rust crates Change-Id: I33f2dc475b6c725ebc024c57021db93af2502060
-rw-r--r--tests/test_expr.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_expr.rs b/tests/test_expr.rs
index 8c0cc28..e8386d0 100644
--- a/tests/test_expr.rs
+++ b/tests/test_expr.rs
@@ -82,7 +82,7 @@ fn test_env_literal() {
#[test]
fn test_env_present() {
paste! {
- struct [<Lib env!("CARGO_PKG_NAME")>];
+ struct [<Lib "paste">];
let _ = Libpaste;
}
@@ -137,7 +137,7 @@ fn test_empty() {
#[test]
fn test_env_to_lower() {
paste! {
- struct [<Lib env!("CARGO_PKG_NAME"):lower>];
+ struct [<Lib "paste":lower>];
let _ = Libpaste;
}
@@ -146,7 +146,7 @@ fn test_env_to_lower() {
#[test]
fn test_env_to_upper() {
paste! {
- const [<LIB env!("CARGO_PKG_NAME"):upper>]: &str = "libpaste";
+ const [<LIB "paste":upper>]: &str = "libpaste";
let _ = LIBPASTE;
}
@@ -155,7 +155,7 @@ fn test_env_to_upper() {
#[test]
fn test_env_to_snake() {
paste! {
- const [<LIB env!("CARGO_PKG_NAME"):snake:upper>]: &str = "libpaste";
+ const [<LIB "paste":snake:upper>]: &str = "libpaste";
let _ = LIBPASTE;
}
@@ -165,7 +165,7 @@ fn test_env_to_snake() {
fn test_env_to_camel() {
paste! {
#[allow(non_upper_case_globals)]
- const [<LIB env!("CARGO_PKG_NAME"):camel>]: &str = "libpaste";
+ const [<LIB "paste":camel>]: &str = "libpaste";
let _ = LIBPaste;
}