feat(app): choose a studyset's licence, its year and holder
The studyset sheet gains Licence, as before: "Help me choose" asks three questions (keep any rights? commercial use? adaptations, alike?) and recommends one of the six current Creative Commons licences or CC0, with what it lets others do and a link to its terms; the licence field suggests well-known licences and takes any other as typed, kept in one spelling (`cc by-nc-sa 3.0 us` is `CC-BY-NC-SA-3.0-US`); the year sits at its end (1000 to next year), the holder below. An older or ported Creative Commons licence gets a note naming its current version. A new sub-studyset starts with the licence of the one it is in. Left out until publishing exists: the warnings about sub-studysets' licences that a parent's doesn't cover. The licence shows for every studyset, as there is no visibility yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
b1ef9b9d3a
commit
bd6016ee1b
1 changed files with 1385 additions and 9 deletions
|
|
@ -0,0 +1,26 @@
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/studyset/model/license.dart';
|
||||
|
||||
void main() {
|
||||
test('a licence is kept in one spelling: known ones as known, Creative '
|
||||
'Commons by its identifier, anything else as typed', () {
|
||||
expect(canonicalLicense('Cc By 4.0'), 'CC-BY-4.0');
|
||||
expect(canonicalLicense('cc_by_sa'), 'CC-BY-SA-4.0');
|
||||
expect(canonicalLicense('public domain'), 'CC0-1.0');
|
||||
expect(canonicalLicense('mit'), 'MIT');
|
||||
expect(canonicalLicense('arr'), 'All Rights Reserved');
|
||||
expect(canonicalLicense('cc by-nc-sa 3.0 us'), 'CC-BY-NC-SA-3.0-US');
|
||||
expect(canonicalLicense(' My own terms '), 'My own terms');
|
||||
expect(canonicalLicense(' '), isNull);
|
||||
expect(canonicalLicense(null), isNull);
|
||||
});
|
||||
|
||||
test('an older or ported Creative Commons licence has a current version; '
|
||||
'a current one, or another licence, none', () {
|
||||
expect(newerCreativeCommons('CC-BY-NC-SA-3.0-US'), 'CC-BY-NC-SA-4.0');
|
||||
expect(newerCreativeCommons('CC-BY-2.0'), 'CC-BY-4.0');
|
||||
expect(newerCreativeCommons('CC-BY-SA-4.0'), isNull);
|
||||
expect(newerCreativeCommons('CC0-1.0'), isNull);
|
||||
expect(newerCreativeCommons('MIT'), isNull);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue