about summary refs log tree commit diff
path: root/src/bootstrap/config
diff options
context:
space:
mode:
authorhi-rustin <rustin.liu@gmail.com>2023-07-03 09:16:44 +0800
committerhi-rustin <rustin.liu@gmail.com>2023-07-09 13:53:26 +0800
commit92b5d0c4cb1f369442beb79f87aa6114987e7956 (patch)
treedcad8473f213892558676d62ead98fd6626ab9b0 /src/bootstrap/config
parent839e9a6e1210934fd24b15548b811a97c77138fc (diff)
downloadrust-92b5d0c4cb1f369442beb79f87aa6114987e7956.tar.gz
rust-92b5d0c4cb1f369442beb79f87aa6114987e7956.zip
Use String or Int to set the opt level
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
Diffstat (limited to 'src/bootstrap/config')
-rw-r--r--src/bootstrap/config/tests.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bootstrap/config/tests.rs b/src/bootstrap/config/tests.rs
index 732df54cdac..c340bb2982a 100644
--- a/src/bootstrap/config/tests.rs
+++ b/src/bootstrap/config/tests.rs
@@ -184,7 +184,10 @@ fn rust_optimize() {
     assert_eq!(parse("").rust_optimize.is_release(), true);
     assert_eq!(parse("rust.optimize = false").rust_optimize.is_release(), false);
     assert_eq!(parse("rust.optimize = true").rust_optimize.is_release(), true);
-    assert_eq!(parse("rust.optimize = \"1\"").rust_optimize.get_opt_level(), Some("1".to_string()));
+    assert_eq!(parse("rust.optimize = 0").rust_optimize.is_release(), false);
+    assert_eq!(parse("rust.optimize = 1").rust_optimize.is_release(), true);
+    assert_eq!(parse("rust.optimize = 1").rust_optimize.get_opt_level(), Some("1".to_string()));
+    assert_eq!(parse("rust.optimize = \"s\"").rust_optimize.is_release(), true);
     assert_eq!(parse("rust.optimize = \"s\"").rust_optimize.get_opt_level(), Some("s".to_string()));
 }