From: Aymeric Agon-Rambosson <aymeric.agon@yandex.com>
Date: Sun, 15 Jan 2023 08:59:31 +0100
Subject: Unbreak unit tests that failed due to trampoline compilation
Forwarded: https://github.com/joaotavora/yasnippet/pull/1158

The trampoline compilation of primitive buffer-list due to macro
yas-with-overriden-buffer-list makes three tests fail :
* 5/91 basic-jit-loading
* 6/91 basic-jit-loading-with-compiled-snippets
* 80/91 visiting-compiled-snippets

We aren't exactly sure why.

In the meantime, a quick workaround is to deactivate trampoline compilation
optimisation for this primitive.

--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -36,6 +36,10 @@
 (require 'org)
 
 
+
+(with-eval-after-load 'comp
+  (push 'buffer-list native-comp-never-optimize-functions))
+
 ;;; Helper macros and function
 
 (defmacro yas-with-snippet-dirs (dirs &rest body)
