Skip to content

Commit

Permalink
Added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Sep 10, 2024
1 parent 32853b8 commit 5007f68
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/halfvec_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'package:pgvector/pgvector.dart';
import 'package:test/test.dart';

void main() {
test('works', () {
var vec = HalfVector([1, 2, 3]);
expect(vec.toString(), equals('[1.0, 2.0, 3.0]'));
expect(vec.toList(), equals([1, 2, 3]));
});
}
10 changes: 10 additions & 0 deletions test/sparsevec_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'package:pgvector/pgvector.dart';
import 'package:test/test.dart';

void main() {
test('works', () {
var vec = SparseVector([1, 0, 2, 0, 3, 0]);
expect(vec.toString(), equals('{1:1.0,3:2.0,5:3.0}/6'));
expect(vec.toList(), equals([1, 0, 2, 0, 3, 0]));
});
}
10 changes: 10 additions & 0 deletions test/vector_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'package:pgvector/pgvector.dart';
import 'package:test/test.dart';

void main() {
test('works', () {
var vec = Vector([1, 2, 3]);
expect(vec.toString(), equals('[1.0, 2.0, 3.0]'));
expect(vec.toList(), equals([1, 2, 3]));
});
}

0 comments on commit 5007f68

Please sign in to comment.