From 2ed726e99cb9145d744bf135dabd2c7eac6607e1 Mon Sep 17 00:00:00 2001 From: mpadge Date: Wed, 21 Jun 2023 18:20:19 +0200 Subject: [PATCH] re-order trace columns for #14 --- DESCRIPTION | 2 +- R/load-and-clear-traces.R | 6 +++--- codemeta.json | 2 +- tests/testthat/test-trace-fns.R | 6 +++--- tests/testthat/test-trace-package.R | 9 ++++++--- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b052e75..3a4b0c8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: typetracer Title: Trace Function Parameter Types -Version: 0.1.1.015 +Version: 0.1.1.016 Authors@R: c( person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2172-5265")), diff --git a/R/load-and-clear-traces.R b/R/load-and-clear-traces.R index a9b0f21..15cb247 100644 --- a/R/load-and-clear-traces.R +++ b/R/load-and-clear-traces.R @@ -27,7 +27,7 @@ load_traces <- function (files = FALSE, quiet = FALSE) { fn_name <- tr_i$fn_name par_formals <- tr_i$formals num_traces <- tr_i$num_traces - trace_source <- tr_i$source + trace_source <- tr_i$source # only exists for packages tr_i <- tr_i [which (!names (tr_i) %in% c ("fn_name", "formals", "num_traces", "source"))] @@ -64,10 +64,10 @@ load_traces <- function (files = FALSE, quiet = FALSE) { trace_name = i, trace_number = num_traces, trace_source = trace_source, - trace_file = call_envs$file, - call_env = call_envs$call_env, fn_name = fn_name, fn_call_hash = fn_call_hash, + trace_file = call_envs$file, + call_env = call_envs$call_env, par_name = par_name, class = classes, typeof = types, diff --git a/codemeta.json b/codemeta.json index 49c8d1a..681c90f 100644 --- a/codemeta.json +++ b/codemeta.json @@ -11,7 +11,7 @@ "codeRepository": "https://github.com/mpadge/typetracer", "issueTracker": "https://github.com/mpadge/typetracer/issues", "license": "https://spdx.org/licenses/MIT", - "version": "0.1.1.015", + "version": "0.1.1.016", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/tests/testthat/test-trace-fns.R b/tests/testthat/test-trace-fns.R index 1427f67..0a1a711 100644 --- a/tests/testthat/test-trace-fns.R +++ b/tests/testthat/test-trace-fns.R @@ -62,10 +62,10 @@ test_that ("trace call", { names (x), c ( "trace_name", "trace_number", + "fn_name", "fn_call_hash", "trace_file", "call_env", - "fn_name", "fn_call_hash", "par_name", - "class", "typeof", "mode", "storage_mode", "length", - "formal", "uneval", "eval" + "par_name", "class", "typeof", "mode", "storage_mode", + "length", "formal", "uneval", "eval" ) ) }) diff --git a/tests/testthat/test-trace-package.R b/tests/testthat/test-trace-package.R index 70e6967..34cb933 100644 --- a/tests/testthat/test-trace-package.R +++ b/tests/testthat/test-trace-package.R @@ -29,8 +29,9 @@ test_that ("trace installed package", { names (x0), c ( "trace_number", "trace_source", + "fn_name", "fn_call_hash", "trace_file", "call_env", - "fn_name", "fn_call_hash", "par_name", "class", + "par_name", "class", "typeof", "mode", "storage_mode", "length", "formal", "uneval", "eval", "source" ) @@ -48,8 +49,9 @@ test_that ("trace installed package", { names (x1), c ( "trace_number", "trace_source", + "fn_name", "fn_call_hash", "trace_file", "call_env", - "fn_name", "fn_call_hash", "par_name", "class", + "par_name", "class", "typeof", "mode", "storage_mode", "length", "formal", "uneval", "eval", "source" ) @@ -94,8 +96,9 @@ test_that ("trace source package", { names (x0), c ( "trace_number", "trace_source", + "fn_name", "fn_call_hash", "trace_file", "call_env", - "fn_name", "fn_call_hash", "par_name", "class", + "par_name", "class", "typeof", "mode", "storage_mode", "length", "formal", "uneval", "eval", "source" )