From 9649f3ea301d952f29b8bf7b57370724abc6402c Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 5 Dec 2023 16:14:08 -0500 Subject: let's try that again --- 2023/info/test-after.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to '2023/info/test-after.md') diff --git a/2023/info/test-after.md b/2023/info/test-after.md index b4262348..0d627caf 100644 --- a/2023/info/test-after.md +++ b/2023/info/test-after.md @@ -5,7 +5,7 @@ # Transcript -[[!template new="1" text="""Introduction""" video="00:00:03.120" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Introduction""" start="00:00:03.120" video="mainVideo-test" id="subtitle"]] [[!template text="""Hi everyone! I'm Mats Lidell.""" start="00:00:03.120" video="mainVideo-test" id="subtitle"]] [[!template text="""I'm going to talk about my journey""" start="00:00:07.440" video="mainVideo-test" id="subtitle"]] @@ -61,7 +61,7 @@ [[!template text="""no knowledge of what testing frameworks existed,""" start="00:03:00.760" video="mainVideo-test" id="subtitle"]] [[!template text="""and not really knowing a lot about Emacs Lisp at all.""" start="00:03:03.360" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""ERT: Emacs Lisp Regression Testing""" video="00:03:11.160" id="subtitle"mainVideo-test]] +[[!template new="1" text="""ERT: Emacs Lisp Regression Testing""" start="00:03:11.160" video="mainVideo-test" id="subtitle"]] [[!template text="""Luckily there is a package for writing tests in Emacs.""" start="00:03:11.160" video="mainVideo-test" id="subtitle"]] [[!template text="""It is called ERT: Emacs Lisp Regression Testing.""" start="00:03:13.800" video="mainVideo-test" id="subtitle"]] @@ -82,7 +82,7 @@ [[!template text="""and the outcome of the test is evaluated.""" start="00:04:09.760" video="mainVideo-test" id="subtitle"]] [[!template text="""Did the test succeed or not?""" start="00:04:13.120" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Assertions with `should`""" video="00:04:14.360" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Assertions with `should`""" start="00:04:14.360" video="mainVideo-test" id="subtitle"]] [[!template text="""The verification of a test is performed with""" start="00:04:14.360" video="mainVideo-test" id="subtitle"]] [[!template text="""one or more so-called assertions.""" start="00:04:18.480" video="mainVideo-test" id="subtitle"]] @@ -95,7 +95,7 @@ [[!template text="""This simple test verifies that the function `+`""" start="00:04:48.581" video="mainVideo-test" id="subtitle"]] [[!template text="""can add the numbers 2 and 3 and get the result 5.""" start="00:04:51.920" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Running a test case""" video="00:04:56.920" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Running a test case""" start="00:04:56.920" video="mainVideo-test" id="subtitle"]] [[!template text="""So now we have defined a test case. How do we run it?""" start="00:04:56.920" video="mainVideo-test" id="subtitle"]] [[!template text="""The ERT package has the function (or""" start="00:05:01.960" video="mainVideo-test" id="subtitle"]] @@ -121,7 +121,7 @@ [[!template text="""and it was 5 equals to 5.""" start="00:06:48.000" video="mainVideo-test" id="subtitle"]] [[!template text="""So a good example of a successful test case.""" start="00:06:49.800" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Debug a test""" video="00:06:54.560" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Debug a test""" start="00:06:54.560" video="mainVideo-test" id="subtitle"]] [[!template text="""So now we've seen how we can run a test case.""" start="00:06:54.560" video="mainVideo-test" id="subtitle"]] [[!template text="""Can we debug it? Yes. For debugging a test case,""" start="00:06:57.920" video="mainVideo-test" id="subtitle"]] @@ -134,7 +134,7 @@ [[!template text="""and we can inspect here what's happening.""" start="00:07:35.660" video="mainVideo-test" id="subtitle"]] [[!template text="""Step through it and yes it succeeded just as before.""" start="00:07:40.680" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Commercial break: Hyperbole""" video="00:07:50.380" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Commercial break: Hyperbole""" start="00:07:50.380" video="mainVideo-test" id="subtitle"]] [[!template text="""It's time for a commercial break!""" start="00:07:50.380" video="mainVideo-test" id="subtitle"]] [[!template text="""Hyperbole itself can help with running tests""" start="00:07:56.880" video="mainVideo-test" id="subtitle"]] @@ -154,7 +154,7 @@ [[!template text="""to get the assist key, and then we're in the debugger.""" start="00:08:54.480" video="mainVideo-test" id="subtitle"]] [[!template text="""So that's pretty useful and convenient.""" start="00:08:57.720" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Instrument function on the fly""" video="00:09:10.480" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Instrument function on the fly""" start="00:09:10.480" video="mainVideo-test" id="subtitle"]] [[!template text="""A related useful feature here is the step-in functionality""" start="00:09:10.480" video="mainVideo-test" id="subtitle"]] [[!template text="""bound to the letter i in `debug-mode`.""" start="00:09:13.720" video="mainVideo-test" id="subtitle"]] @@ -178,7 +178,7 @@ [[!template text="""and it returns the result 4 as expected.""" start="00:10:26.560" video="mainVideo-test" id="subtitle"]] [[!template text="""And yes, of course, our test case will then succeed.""" start="00:10:31.000" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Mocking""" video="00:10:39.120" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Mocking""" start="00:10:39.120" video="mainVideo-test" id="subtitle"]] [[!template text="""The next tool in our toolbox is mocking.""" start="00:10:39.120" video="mainVideo-test" id="subtitle"]] [[!template text="""Mocking is needed when we want to simulate the response""" start="00:10:41.840" video="mainVideo-test" id="subtitle"]] @@ -256,7 +256,7 @@ [[!template text="""and see that it should also then return 10""" start="00:14:30.320" video="mainVideo-test" id="subtitle"]] [[!template text="""because it's using `f1-add`.""" start="00:14:32.800" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""cl-letf""" video="00:14:41.240" id="subtitle"mainVideo-test]] +[[!template new="1" text="""cl-letf""" start="00:14:41.240" video="mainVideo-test" id="subtitle"]] [[!template text="""Moving over to `cl-letf`.""" start="00:14:41.240" video="mainVideo-test" id="subtitle"]] [[!template text="""In rare occasions, the limitations of `el-mock` means""" start="00:14:44.560" video="mainVideo-test" id="subtitle"]] @@ -271,7 +271,7 @@ [[!template text="""due to environment issues.""" start="00:15:11.240" video="mainVideo-test" id="subtitle"]] [[!template text="""In that case, a static mock will not work.""" start="00:15:13.740" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Hooks""" video="00:15:24.100" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Hooks""" start="00:15:24.100" video="mainVideo-test" id="subtitle"]] [[!template text="""Another trick is that functions that uses hooks.""" start="00:15:24.100" video="mainVideo-test" id="subtitle"]] [[!template text="""You can overload or replace the hooks to do the testing.""" start="00:15:30.720" video="mainVideo-test" id="subtitle"]] @@ -280,7 +280,7 @@ [[!template text="""Also, here you need to be careful""" start="00:15:43.120" video="mainVideo-test" id="subtitle"]] [[!template text="""to make sure the test handler is called and nothing else.""" start="00:15:45.080" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Side effects and initial buffer state""" video="00:15:55.720" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Side effects and initial buffer state""" start="00:15:55.720" video="mainVideo-test" id="subtitle"]] [[!template text="""So far we have been talking about testing""" start="00:15:55.720" video="mainVideo-test" id="subtitle"]] [[!template text="""and what the function returns.""" start="00:15:57.680" video="mainVideo-test" id="subtitle"]] @@ -308,14 +308,14 @@ [[!template text="""Here are some functions and variables""" start="00:16:50.960" video="mainVideo-test" id="subtitle"]] [[!template text="""I have found useful for this.""" start="00:16:53.080" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""with-temp-buffer""" video="00:17:05.100" id="subtitle"mainVideo-test]] +[[!template new="1" text="""with-temp-buffer""" start="00:17:05.100" video="mainVideo-test" id="subtitle"]] [[!template text="""For creating tests: `with-temp-buffer`:""" start="00:17:05.100" video="mainVideo-test" id="subtitle"]] [[!template text="""it provides you a temp buffer that you visit,""" start="00:17:09.200" video="mainVideo-test" id="subtitle"]] [[!template text="""and afterwards, there is no need to clean up.""" start="00:17:11.920" video="mainVideo-test" id="subtitle"]] [[!template text="""This is the first choice if that is all you need.""" start="00:17:13.720" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""make-temp-file""" video="00:17:16.520" id="subtitle"mainVideo-test]] +[[!template new="1" text="""make-temp-file""" start="00:17:16.520" video="mainVideo-test" id="subtitle"]] [[!template text="""`make-temp-file`: If you need a file,""" start="00:17:16.520" video="mainVideo-test" id="subtitle"]] [[!template text="""this is the function to use.""" start="00:17:20.520" video="mainVideo-test" id="subtitle"]] @@ -324,7 +324,7 @@ [[!template text="""This needs to be cleaned up after a test.""" start="00:17:26.960" video="mainVideo-test" id="subtitle"]] [[!template text="""Moving on to verifying and debugging:""" start="00:17:31.020" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""buffer-string""" video="00:17:33.288" id="subtitle"mainVideo-test]] +[[!template new="1" text="""buffer-string""" start="00:17:33.288" video="mainVideo-test" id="subtitle"]] [[!template text="""`buffer-string`: returns the full contents""" start="00:17:33.288" video="mainVideo-test" id="subtitle"]] [[!template text="""of the buffer as a string.""" start="00:17:38.248" video="mainVideo-test" id="subtitle"]] @@ -340,7 +340,7 @@ [[!template text="""There might be other ways to do the same""" start="00:18:04.400" video="mainVideo-test" id="subtitle"]] [[!template text="""as we saw with debugging.""" start="00:18:06.248" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""buffer-name""" video="00:18:09.920" id="subtitle"mainVideo-test]] +[[!template new="1" text="""buffer-name""" start="00:18:09.920" video="mainVideo-test" id="subtitle"]] [[!template text="""buffer-name: Getting the buffer name is good""" start="00:18:09.920" video="mainVideo-test" id="subtitle"]] [[!template text="""to verify what buffer we are looking at.""" start="00:18:13.720" video="mainVideo-test" id="subtitle"]] @@ -358,12 +358,12 @@ [[!template text="""that I have not fully learned how to master,""" start="00:18:44.880" video="mainVideo-test" id="subtitle"]] [[!template text="""so assertion for checking the sanity of the test is good.""" start="00:18:47.488" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""major-mode""" video="00:18:51.980" id="subtitle"mainVideo-test]] +[[!template new="1" text="""major-mode""" start="00:18:51.980" video="mainVideo-test" id="subtitle"]] [[!template text="""Finally, `major-mode`: Verify the buffer has the proper mode.""" start="00:18:51.980" video="mainVideo-test" id="subtitle"]] [[!template text="""Can also be very useful and is a good sanity check.""" start="00:18:55.680" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""unwind-protect""" video="00:19:02.680" id="subtitle"mainVideo-test]] +[[!template new="1" text="""unwind-protect""" start="00:19:02.680" video="mainVideo-test" id="subtitle"]] [[!template text="""Finally, cleaning up. `unwind-protect`.""" start="00:19:02.680" video="mainVideo-test" id="subtitle"]] [[!template text="""The tool for cleaning up is the `unwind-protect` form""" start="00:19:06.600" video="mainVideo-test" id="subtitle"]] @@ -383,7 +383,7 @@ [[!template text="""The test buffers are often in the state""" start="00:20:03.220" video="mainVideo-test" id="subtitle"]] [[!template text="""where they have not been saved but modified.""" start="00:20:05.440" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Input, with-simulated-input""" video="00:20:15.100" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Input, with-simulated-input""" start="00:20:15.100" video="mainVideo-test" id="subtitle"]] [[!template text="""Another problem for tests are input.""" start="00:20:15.100" video="mainVideo-test" id="subtitle"]] [[!template text="""In the middle of execution a function""" start="00:20:19.680" video="mainVideo-test" id="subtitle"]] @@ -412,7 +412,7 @@ [[!template text="""As you see in the example, space needs to be provided""" start="00:21:26.120" video="mainVideo-test" id="subtitle"]] [[!template text="""by the string SPC, as return by the string RET.""" start="00:21:29.640" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Running all tests""" video="00:21:38.460" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Running all tests""" start="00:21:38.460" video="mainVideo-test" id="subtitle"]] [[!template text="""So now we have seen ways to create test cases""" start="00:21:38.460" video="mainVideo-test" id="subtitle"]] [[!template text="""and even make it possible to run some of them""" start="00:21:40.800" video="mainVideo-test" id="subtitle"]] @@ -435,7 +435,7 @@ [[!template text="""So here we have a nice green display""" start="00:22:51.420" video="mainVideo-test" id="subtitle"]] [[!template text="""with all the test cases.""" start="00:22:57.080" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Batch mode""" video="00:23:03.220" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Batch mode""" start="00:23:03.220" video="mainVideo-test" id="subtitle"]] [[!template text="""So that was fine, but we were still running it manually""" start="00:23:03.220" video="mainVideo-test" id="subtitle"]] [[!template text="""by calling ert. How could we run it from the command line?""" start="00:23:08.160" video="mainVideo-test" id="subtitle"]] @@ -454,7 +454,7 @@ [[!template text="""to get away with the prompt for excessive backup files""" start="00:23:58.160" video="mainVideo-test" id="subtitle"]] [[!template text="""that can pile up after running the tests a few times.""" start="00:24:02.440" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Skipping tests""" video="00:24:05.060" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Skipping tests""" start="00:24:05.060" video="mainVideo-test" id="subtitle"]] [[!template text="""Even with the help of simulated input,""" start="00:24:05.060" video="mainVideo-test" id="subtitle"]] [[!template text="""not all tests can be run in batch mode.""" start="00:24:06.880" video="mainVideo-test" id="subtitle"]] @@ -494,7 +494,7 @@ [[!template text="""and that is then another problem""" start="00:25:59.400" video="mainVideo-test" id="subtitle"]] [[!template text="""with getting the interactive mode.""" start="00:26:03.201" video="mainVideo-test" id="subtitle"]] -[[!template new="1" text="""Conclusion""" video="00:26:08.460" id="subtitle"mainVideo-test]] +[[!template new="1" text="""Conclusion""" start="00:26:08.460" video="mainVideo-test" id="subtitle"]] [[!template text="""We have reached the end of the talk.""" start="00:26:08.460" video="mainVideo-test" id="subtitle"]] [[!template text="""If you have any new ideas""" start="00:26:11.121" video="mainVideo-test" id="subtitle"]] -- cgit v1.2.3