aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testing.c
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-19 12:26:08 -0600
committerJosh Rahm <rahm@google.com>2022-08-19 13:06:41 -0600
commita7237662f96933efe29eed8212464571e3778cd0 (patch)
tree27930202726b4251437c8cfa53069f65b4db90dc /src/nvim/testing.c
parent02292344929069ea63c0bb872cc22d552d86b67f (diff)
parentb2f979b30beac67906b2dd717fcb6a34f46f5e54 (diff)
downloadrneovim-tmp.tar.gz
rneovim-tmp.tar.bz2
rneovim-tmp.zip
Merge branch 'master' of https://github.com/neovim/neovim into rahmtmp
Diffstat (limited to 'src/nvim/testing.c')
-rw-r--r--src/nvim/testing.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/nvim/testing.c b/src/nvim/testing.c
index 69b687e44f..e70e9f2cbd 100644
--- a/src/nvim/testing.c
+++ b/src/nvim/testing.c
@@ -7,6 +7,7 @@
#include "nvim/eval/encode.h"
#include "nvim/ex_docmd.h"
#include "nvim/os/os.h"
+#include "nvim/runtime.h"
#include "nvim/testing.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
@@ -17,21 +18,23 @@
static void prepare_assert_error(garray_T *gap)
{
char buf[NUMBUFLEN];
+ char *sname = estack_sfile(ESTACK_NONE);
ga_init(gap, 1, 100);
- if (sourcing_name != NULL) {
- ga_concat(gap, (char *)sourcing_name);
- if (sourcing_lnum > 0) {
+ if (sname != NULL) {
+ ga_concat(gap, sname);
+ if (SOURCING_LNUM > 0) {
ga_concat(gap, " ");
}
}
- if (sourcing_lnum > 0) {
- vim_snprintf(buf, ARRAY_SIZE(buf), "line %" PRId64, (int64_t)sourcing_lnum);
+ if (SOURCING_LNUM > 0) {
+ vim_snprintf(buf, ARRAY_SIZE(buf), "line %" PRId64, (int64_t)SOURCING_LNUM);
ga_concat(gap, buf);
}
- if (sourcing_name != NULL || sourcing_lnum > 0) {
+ if (sname != NULL || SOURCING_LNUM > 0) {
ga_concat(gap, ": ");
}
+ xfree(sname);
}
/// Append "p[clen]" to "gap", escaping unprintable characters.