Consolidate variable pretty printing

This commit is contained in:
Ayaz Hafiz 2022-05-10 11:24:41 -04:00
parent 3de35f7aa2
commit a9507cf917
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
7 changed files with 28 additions and 43 deletions

View file

@ -29,7 +29,7 @@ mod test_load {
use roc_reporting::report::RenderTarget;
use roc_reporting::report::RocDocAllocator;
use roc_target::TargetInfo;
use roc_types::pretty_print::{content_to_string, name_all_type_vars};
use roc_types::pretty_print::name_and_print_var;
use roc_types::subs::Subs;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
@ -237,10 +237,7 @@ mod test_load {
expected_types: &mut HashMap<&str, &str>,
) {
for (symbol, expr_var) in &def.pattern_vars {
let named_result = name_all_type_vars(*expr_var, subs);
let content = subs.get_content_without_compacting(*expr_var);
let actual_str = content_to_string(content, subs, home, interns, named_result);
let actual_str = name_and_print_var(*expr_var, subs, home, interns);
let fully_qualified = symbol.fully_qualified(interns, home).to_string();
let expected_type = expected_types
.remove(fully_qualified.as_str())