Ihor Radchenko writes: > "Christopher M. Miles" writes: > >>> However, upon testing your patch, tests are still failing on my side. >>> Can you please investigate? >> >> But If I use [M-x ert] to run the test "test-org-fold/org-fold-display-inline-images" is passed. >> Here is the steps: >> 1. [M-x load-file RET /path/to/org-mode/testing/org-test.el RET] >> 2. [C-M-x] to evaluate the target test >> 3. [M-x ert RET test-org-fold/org-fold-display-inline-images RET] to run this test >> >> I attached the uploaded screencast video link to prove it passed. >> >> https://share.cleanshot.com/tvUUoQ >> >> I tried many different other API functions to cycle or fold/unfold, but none >> of them works under command "make test" or command >> "make BTEST_RE="test-org-fold/org-fold-display-inline-images" test-dirty". >> >> I have nothing brain to think for this test now. Really can't figure out >> why this image is not displayed as overlay. Can you help me to fix this test? > > The problem is with batch mode. `create-image' will return nil in batch > mode and hence no overlays are ever created even though > `org-display-inline-images' does get called. I see, no wonder that failed for command "make test" but success in "[M-x ert]". > I think that the best we can do in this situation is mocking > `create-image' in batch mode to return non-nil using `cl-letf'. I checked the `create-image' in image.el source code, don't know how to mocking this. I have no experience and idea about this. I also searched org testing. Have not found similar situations. If you have idea how to write this test, I suggest pass this word to you. What do you think? -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3