rust/src/test/run-pass/env-null-vars.rs
2018-12-25 21:08:33 -07:00

22 lines
359 B
Rust

#![allow(unused_imports)]
// ignore-windows
// ignore-wasm32-bare no libc to test ffi with
// issue-53200
#![feature(rustc_private)]
extern crate libc;
use std::env;
// FIXME: more platforms?
#[cfg(target_os = "linux")]
fn main() {
unsafe { libc::clearenv(); }
assert_eq!(env::vars().count(), 0);
}
#[cfg(not(target_os = "linux"))]
fn main() {}