### ----------------------------------------------------
### -- Math::Nearest
### -- Licenses: Artistic-2.0
### -- Authors: Anton Antonov
### -- File: xt/10-Same-NNs-for-nD-points.rakutest
### ----------------------------------------------------
use v6.d;
use Test;

use lib <. lib>;
use Math::Nearest;

my $dim = 4;
my @points = (rand xx $dim) xx 100;

my $distance-function = 'euclidean-distance';
my &nScan = nearest(@points, :$distance-function, method => 'Scan');
my &nKDTree = nearest(@points, :$distance-function, method => 'KDTree');

## 1
my @point1 = rand xx $dim;
is &nKDTree(@point1, 3), &nScan(@point1, 3);

## 2
my @point2 = rand xx $dim;
is &nKDTree(@point2, (Whatever, 0.3)).sort, &nScan(@point2, (Whatever, 0.3)).sort;


done-testing;


