mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(reference): add ability to create direct reference
This commit is contained in:
parent
6643527f2d
commit
9190ed2e0f
16 changed files with 669 additions and 60 deletions
|
@ -1,6 +1,5 @@
|
|||
import 'package:test/test.dart';
|
||||
import 'package:libgit2dart/src/oid.dart';
|
||||
import 'package:libgit2dart/src/error.dart';
|
||||
|
||||
void main() {
|
||||
const sha = '9d81c715ff606057fa448e558c7458467a86c8c7';
|
||||
|
@ -10,9 +9,12 @@ void main() {
|
|||
test('initializes successfully', () {
|
||||
expect(Oid.fromSHA(sha), isA<Oid>());
|
||||
});
|
||||
});
|
||||
|
||||
test('throws when hex string is lesser than 40 characters', () {
|
||||
expect(() => Oid.fromSHA('9d8'), throwsA(isA<LibGit2Error>()));
|
||||
group('fromSHAn()', () {
|
||||
test('initializes successfully from short hex string', () {
|
||||
final oid = Oid.fromSHAn('9d81');
|
||||
expect(oid, isA<Oid>());
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue