4
$\begingroup$

I build a testing notebook and it got too slow and unreliable with many test cases.

I want to have a new (classical) notebook with all the the inputs I have in the testing one. Is there an automatic way to do that (except for manual copy and paste)? The option More > Convert Selection to Test doesn't seem to have any effect on my selections.

$\endgroup$
2
  • $\begingroup$ That's pretty cool. Thanks, you should post an answer $\endgroup$
    – mete
    Nov 13, 2014 at 19:52
  • $\begingroup$ I have the same issue. Large testing notebooks seem to become extremely slow. $\endgroup$
    – masterxilo
    Aug 25, 2016 at 20:43

1 Answer 1

5
$\begingroup$

This was the first time I played with Test Notebook so maybe I missed something obvious. But it works for OP so:

(Composition[
            CellPrint, 
            ReplacePart[#, 2 -> "Input"] &,
            NotebookRead
           ] /@   Cells[ # ,   CellStyle -> "VerificationTest"]
)& 

One should apply that function to the Notebook Object of interest.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.