Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-09-08 Thread Bruno Barbier
Ihor Radchenko writes: > Bruno Barbier writes: > >> From 86a5443948fc84a6a412ccf49d0c537608f465a7 Mon Sep 17 00:00:00 2001 >> From: Bruno BARBIER >> Date: Fri, 18 Nov 2022 20:14:20 +0100 >> Subject: [PATCH 1/7] ob-haskell: Add tests for GHCi >> ... > > Thanks! > Applied, onto main. > I also

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-09-08 Thread Ihor Radchenko
Bruno Barbier writes: > From 86a5443948fc84a6a412ccf49d0c537608f465a7 Mon Sep 17 00:00:00 2001 > From: Bruno BARBIER > Date: Fri, 18 Nov 2022 20:14:20 +0100 > Subject: [PATCH 1/7] ob-haskell: Add tests for GHCi > ... Thanks! Applied, onto main. I also added a missing defvar declaration for

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-09-07 Thread Bruno Barbier
Hi Ihor, Sorry for the delay, thanks again for the ping. Ihor Radchenko writes: > Bruno Barbier writes: > + (when (bufferp "*haskell*") (error "Conflicting buffer '*haskell*', rename it or kill it.")) + (with-current-buffer session (rename-buffer

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-08-25 Thread Bruno Barbier
Hi Ihor, Ihor Radchenko writes: > A few months have passed since the last activity in this thread. > Bruno, may I know if you are still interested to work on the patch? Thanks for the reminder. I'm definitely interested to closing that thread. I'll review my last changes and send my

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-08-10 Thread Ihor Radchenko
A few months have passed since the last activity in this thread. Bruno, may I know if you are still interested to work on the patch? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-06-02 Thread Ihor Radchenko
Bruno Barbier writes: >> I can see that you limited the tests scope to :session blocks. >> Would it be possible to extend the existing tests to :compile yes case? >> From a glance, it does not look like you need to change much - Haskell >> behaviour should be similar with or without ghci. > >

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-05-21 Thread Bruno Barbier
Hi Ihor, Thanks for the review. Ihor Radchenko writes: > Bruno Barbier writes: > I can see that you limited the tests scope to :session blocks. > Would it be possible to extend the existing tests to :compile yes case? > From a glance, it does not look like you need to change much -

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-05-08 Thread Ihor Radchenko
Bruno Barbier writes: > Let me know if you see further improvement before pushing this. Thanks for the update! I can see that you limited the tests scope to :session blocks. Would it be possible to extend the existing tests to :compile yes case? >From a glance, it does not look like you need

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-05-07 Thread Bruno Barbier
Ruijie Yu writes: > Minor remarks below regarding the patchset. > > Bruno Barbier writes: > >> +;; Copyright (c) 2023 Free Software Foundation, Inc. > > lisp/org.el has only a single space, so probably single space here as well. Done. >> + >> +;; Authors: Bruno BARBIER >> + >> +;; This

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-05-07 Thread General discussions about Org-mode.
Minor remarks below regarding the patchset. Bruno Barbier writes: > From 9ef867cd2cf89e77b5c5a5a7090fd37b1702e06a Mon Sep 17 00:00:00 2001 > From: Bruno BARBIER > Date: Fri, 18 Nov 2022 20:14:20 +0100 > Subject: [PATCH 01/13] ob-haskell: Add tests for GHCi > >

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-05-07 Thread Bruno Barbier
Hi Ihor, Sorry for the delay. Bruno Barbier writes: > Ihor Radchenko writes: > >> Bruno Barbier writes: >> >>> Note that I've changed the tests about errors; I'm now expecting >>> ob-haskell to raise errors. I'm not sure what we should expect to be >>> consistent with other org babel

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-26 Thread Ihor Radchenko
Bruno Barbier writes: >> Why not simply putStrLn ("\"" ++ show it ++ "\"") ? >> > > I'm not sure I understand. I'm using the first > 'org-babel-comint-with-output' to execute the source block and save the > last value (the "it" variable). Then, I'm using a second > 'org-babel-comint-with-output'

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-26 Thread Bruno Barbier
Ihor Radchenko writes: > Bruno Barbier writes: > >> Note that I've changed the tests about errors; I'm now expecting >> ob-haskell to raise errors. I'm not sure what we should expect to be >> consistent with other org babel backends. > > Errors are usually displayed separately, using >

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-26 Thread Ihor Radchenko
Bruno Barbier writes: > About :results output vs :results value, I decided to use the "it" > variable, i.e. to ask GHCi what was the last value (see [1]). > > About sessions, I decided to rename the buffer as you suggested. That's > a partial workaround that should work well enough, until

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-25 Thread ParetoOptimalDev
Ihor Radchenko writes: > Note that setting the prompt to non-"", makes little sense - we want to > remove it anyway. Why do extra work? Oh, I didn't notice you set the prompt to "". I thought the extra work you were being done was *because* somewhere else the default was set to "λ ". I agree,

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-25 Thread Bruno Barbier
Ihor Radchenko writes: > I investigated further and now applied a set of patches that improves > prompt filtering in org-comint. > .. Thanks Ihor. I don't get random failures anymore. And thanks for fixing the tests that were incorrect. Thanks Pareto for mentioning the possibiliy to

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-24 Thread Ihor Radchenko
Ihor Radchenko writes: > We can try the attached patch. Yet another edge case in comint, it > appears. I investigated further and now applied a set of patches that improves prompt filtering in org-comint.

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-24 Thread Ihor Radchenko
ParetoOptimalDev writes: >> comint-prompt-regexp: ^[[:alnum:].*_() |λ]*> \|^λ?> >> Output: ghci| ghci| ghci| ghci| ghci| 6 >> >> Note "|". > > You can fix this by sending `set :prompt-cont ""`. Here is a > demonstration: I think you meant `:set prompt-cont ""`. It is a good idea, thanks! We

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-23 Thread ParetoOptimalDev
I forgot to mention you can also set the prompt as well to something simple like `:set prompt "> "`. > Ihor Radchenko writes: > >> Part of the problem is that haskell-mode appears to use non-standard >> prompt: >> >> comint-prompt-regexp: ^[[:alnum:].*_() |λ]*> \|^λ?> >> Output: ghci| ghci|

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-23 Thread ParetoOptimalDev
Ihor Radchenko writes: > Part of the problem is that haskell-mode appears to use non-standard > prompt: > > comint-prompt-regexp: ^[[:alnum:].*_() |λ]*> \|^λ?> > Output: ghci| ghci| ghci| ghci| ghci| 6 > > Note "|". You can fix this by sending `set :prompt-cont ""`. Here is a demonstration:

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-23 Thread Ihor Radchenko
Bruno Barbier writes: > +(ert-deftest ob-haskell/let-multilines-1 () > + "Local definitions on multiple lines." > + :expected-result :failed > + (should (equal 6 (test-ob-haskell-ghci "" " > +:{ > + let { x=2 > + ; y=3 > + } > + in x*y > +:} > +" Part of the problem is that

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-22 Thread Ihor Radchenko
Bruno Barbier writes: > Ihor Radchenko writes: > >> From a first look, random failures appear to be related to session >> initialization. > > My function 'test-ob-haskell-ghci' should protect against that; it > ensures the "*haskell*" buffer is always new. From what I understand, > this is an

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-19 Thread Bruno Barbier
Hi Ihor, Ihor Radchenko writes: > From a first look, random failures appear to be related to session > initialization. My function 'test-ob-haskell-ghci' should protect against that; it ensures the "*haskell*" buffer is always new. From what I understand, this is an input buffering problem:

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-19 Thread Ihor Radchenko
Ihor Radchenko writes: > From a first look, random failures appear to be related to session > initialization. It appears that ob-haskell is re-using sessions even > if :session is nil (default). And multiple session not allowed?? (I am > looking at `org-babel-haskell-initiate-session', which

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-03-19 Thread Ihor Radchenko
Bruno Barbier writes: > All the tests will randomly fail; that is an ob-haskell bug (see > the command 'test-ob-haskell-ghci.el' to make them fail). First of all, thanks for the patch! Tests are especially welcome. >From a first look, random failures appear to be related to session

[PATCH] Add tests for ob-haskell (GHCi)

2023-03-19 Thread Bruno Barbier
ect: [PATCH] ob-haskell: Add tests for GHCi testing/lisp/test-ob-haskell-ghci.el: New file. --- testing/lisp/test-ob-haskell-ghci.el | 428 +++ 1 file changed, 428 insertions(+) create mode 100644 testing/lisp/test-ob-haskell-ghci.el diff --git a/testing/lisp/test-ob-hask