| 1 | const std = @import("std"); |
| 2 | const detect = @import("detect-license"); |
| 3 | const expect = @import("expect").expect; |
| 4 | |
| 5 | test { |
| 6 | _ = &detect.detect; |
| 7 | _ = &detect.detectInDir; |
| 8 | _ = &detect.testLicenseFile; |
| 9 | _ = &detect.licenses.find; |
| 10 | _ = &detect.licenses.spdx; |
| 11 | } |
| 12 | test { |
| 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 | } |
| 18 | test { |
| 19 | const alloc = std.testing.allocator; |
| 20 | const license = try detect.detectInDir(alloc, .cwd()); |
| 21 | try expect(license).toEqualString("MIT"); |
| 22 | } |