1const std = @import("std");
2const detect = @import("detect-license");
3const expect = @import("expect").expect;
4
5test {
6 _ = &detect.detect;
7 _ = &detect.detectInDir;
8 _ = &detect.testLicenseFile;
9 _ = &detect.licenses.find;
10 _ = &detect.licenses.spdx;
11}
12test {
13 const alloc = std.testing.allocator;
14 const src = @embedFile("./LICENSE");
15 const license = try detect.detect(alloc, src);
16 try expect(license).toEqualString("MIT");
17}
18test {
19 const alloc = std.testing.allocator;
20 const license = try detect.detectInDir(alloc, .cwd());
21 try expect(license).toEqualString("MIT");
22}