// Copyright (c) Facebook, Inc. and its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use std::collections::BTreeMap;
use std::time::Duration;
use command::expand_fields;
use command::GeneralOpt;
use command::OutputFormat;
use common::logutil::get_logger;
use model::Collector;
use model::Queriable;
use render::HasRenderConfigForDump;
use serde_json::Value;
use tempfile::TempDir;
use tmain::Dumper;
use super::*;
#[test]
// Test correctness of system decoration
fn test_dump_sys_content() {
let logger = get_logger();
let mut collector = Collector::new(logger.clone(), Default::default());
collector
.collect_and_update_model()
.expect("Fail to get model");
let mut opts: GeneralOpt = Default::default();
let mut fields = command::expand_fields(command::DEFAULT_SYSTEM_FIELDS, true);
for subquery_id in enum_iterator::all::<model::SingleCpuModelFieldId>() {
fields.push(DumpField::FieldId(model::SystemModelFieldId::Cpus(
model::BTreeMapFieldId::new(Some(31),