Commit Graph

86 Commits

Author SHA1 Message Date
dae
09253b661c getEmptyDeck() -> getEmptyCol() 2014-06-03 17:38:47 +09:00
dae
e5ed110d65 fix latex test 2014-06-03 17:25:43 +09:00
ispedals
bd289fc37e Close file descriptors before unlinking
Unlinking a file before closing may not be supported on non-POSIX systems
such as Windows. This allows more tests to run to completion.
2014-04-21 17:08:21 -04:00
Julien Baley
a88a8429e2 Makes the test agree with the current behaviour of chained mod (cloze not always first) 2014-04-15 17:39:09 +01:00
Damien Elmes
8b1cca0412 remove debug statements from test 2014-02-19 18:01:29 +09:00
Damien Elmes
6da0e688b3 Merge pull request #64 from julienbaley/chained_mods
Chained mods
2014-02-19 17:59:57 +09:00
Julien Baley
37753b1ffd Adding tests for chained modifiers 2014-02-18 17:26:41 +00:00
Damien Elmes
a0f16d8ecb Merge pull request #59 from chreekat/faster-tests
Speed up tests
2014-02-17 11:22:14 +09:00
Bryan Richter
04d3901491 Test against the value itself 2014-02-12 23:46:38 -08:00
Bryan Richter
827bb84418 Re-use an empty deck to save on creation time. 2014-02-12 23:33:44 -08:00
Bryan Richter
349c95d17a Fix supermemo import test
Broken by 656698d, "Add A Factor to E Factor conversion..."
2014-02-12 23:23:15 -08:00
Damien Elmes
19b1446758 automatically remove from filtered deck before reschedule
commit 79ed57a445 prevented reschedule
on cards in a filtered deck, but it is more user friendly to
automatically move back to the home deck instead. we also don't need
to removeLrn() for review cards, because we're updating type+queue+odue
ourselves
2013-11-26 03:23:03 +09:00
Damien Elmes
99d82c1f2d fix hasIllegal check, and associated unit test 2013-11-26 03:19:11 +09:00
Damien Elmes
f1837e7e0a when ensuring model unique, check id not obj
this should fix an issue where we were attaching a suffix to non-duplicate
names on sync
2013-10-05 23:53:09 +09:00
Damien Elmes
f29a04ae29 bump sync ver to 7 and change meta return value
- /sync/meta now returns a dictionary
- it includes the following extra fields
- msg: if non-empty, show this message at the end of the sync
- cont: if false, show above message and abort sync
- uname: the user's email address, so it can be stored by the local client to
  show users who have forgotten which email address they used. in the future
  this will be saved only when logging in, so do a conditional access on it
2013-10-04 06:09:28 +09:00
Damien Elmes
ec3850aab2 note rollover problem in unit tests 2013-10-02 04:04:06 +09:00
Damien Elmes
0d1d8c5bf9 define standard encoding for unicode (#893)
- always store media references in fields in NFC form
- always encode filenames on disk in NFC form on machines other than macs
- use relevant encoding when placing files in the media folder during syncs
  and apkg imports as well
- rename 'unused media' back to 'check media'
- check media can now automatically change media references and filename
  encodings to the correct format
2013-09-20 19:28:44 +09:00
Damien Elmes
afde11671e rework sibling handling and change bury semantics
First, burying changes:

- unburying now happens on day rollover, or when manually unburying from
  overview screen

- burying is not performed when returning to deck list, or when closing
  collection, so burying now must mark cards as modified to ensure sync
  consistent

- because they're no longer temporary to a session, make sure we exclude them
  in filtered decks in -is:suspended

Sibling spacing changes:

- core behaviour now based on automatically burying related cards when we
  answer a card

- applies to reviews, optionally to new cards, and never to cards in the
  learning queue (partly because we can't suspend/bury cards in that queue at
  the moment)

- this means spacing works consistently in filtered decks now, works on
  reviews even when user is late to review, and provides better separation of
  new cards

- if burying new cards disabled, we just discard them from the current queue.
  an option to set due=ord*space+due would be nicer, but would require
  changing a lot of code and is more appropriate for a future major version
  change. discarding from queue suffers from the same issue as the new card
  cycling in that queue rebuilds may cause cards to be shown close together,
  so the default burying behaviour is preferable

- refer to them as 'related cards' rather than 'siblings'

These changes don't require any changes to the database format, so they
should hopefully coexist with older clients without issue.
2013-08-10 15:56:26 +09:00
Damien Elmes
914f56dbc0 allow updates to existing notes in .apkg import 2013-08-08 13:01:47 +09:00
Damien Elmes
a538e29480 refactor illegal char handling and file adding for media
- add writeData() so we can add files to media folder without having to
  save them in an intermediate folder first
- we were stripping or checking for illegal filename characters in
  multiple places; factor those checks out into separate routines
- add * to invalid char list, and disallow both forward and backslash
- remove size checks in syncAdd(); is handled server-side
2013-07-11 15:33:24 +09:00
Damien Elmes
744d9abfdb fix modification check in note merge 2013-05-28 14:41:12 +09:00
Damien Elmes
7b217c63fe fix unit test 2013-05-27 14:30:23 +09:00
Damien Elmes
918694a096 more media regexp fixes
- split quoted and unquoted image case into separate regexps, since we can't
  include a group reference inside a character set
- disallow spaces in the non-quoted case
- this should fix matching on images with other attributes again
2013-05-22 09:45:58 +09:00
Damien Elmes
3dd72ad4d6 log updates & duplicates (#859) 2013-05-16 17:24:12 +09:00
Damien Elmes
d2535fd6cb run basic integrity check prior to full up 2013-05-13 19:36:09 +09:00
Damien Elmes
735a706bc1 fix import test file 2013-04-11 18:51:38 +09:00
Damien Elmes
9f5d23319d check for dvipng in test 2013-03-16 06:40:03 +09:00
Damien Elmes
71bc925e8b show (end) when exiting with resched=off 2013-02-01 00:25:01 +09:00
Damien Elmes
17b68d5dc0 fix import of suspended anki1 cards (#565) 2013-01-23 15:28:11 +09:00
Damien Elmes
634b28388c remove obsolete test
the server bumps the modtime prior to download these days because it has to
update the usn
2013-01-18 08:43:40 +09:00
Damien Elmes
225f352871 fix thinko in unit tests 2013-01-17 10:39:04 +09:00
Damien Elmes
289f0a6452 automatically fix 1.2 errors when upgrading 2013-01-08 09:43:29 +09:00
Damien Elmes
26ae5e1c47 spread reviews before sibling check 2012-12-22 12:36:51 +09:00
Damien Elmes
b2457811a2 optimize imports 2012-12-22 09:17:10 +09:00
Damien Elmes
e27cbd2cb7 reapply failure mult on failures in lrn queue 2012-12-22 07:32:49 +09:00
Damien Elmes
d477df8c28 merged libanki and ankiqt into single distro 2012-12-21 16:51:59 +09:00