Download server/ai.test.js from SSSAssist/Thoth: direct link, hf CLI and curl.
- Browser
- Download file 913 Bytes
-
https://huggingface.co/spaces/SSSAssist/Thoth/resolve/main/server/ai.test.js
- Command line
-
hf download hf://spaces/SSSAssist/Thoth/server/ai.test.js
-
curl -L -o ai.test.js https://huggingface.co/spaces/SSSAssist/Thoth/resolve/main/server/ai.test.js
913 Bytes
| import assert from 'node:assert/strict'; | |
| import { test } from 'node:test'; | |
| import { bibliographySummary } from './ai.js'; | |
| test('bibliographySummary asistanın gösterebileceği kaynakları özetler', () => { | |
| const bib = `@article{turing1950, | |
| author = {Turing, Alan M.}, | |
| title = {Computing machinery and {intelligence}}, | |
| journal = {Mind}, | |
| year = {1950}, | |
| doi = {10.1093/mind/LIX.236.433} | |
| } | |
| @comment{yok sayılır} | |
| @online{yok2023, title = "Uzaktan eğitim", date = {2023-03-05}} | |
| @book{tarihsiz, author = {Yazar, Ad}, title = {Kitap}} | |
| `; | |
| assert.equal( | |
| bibliographySummary([bib]), | |
| [ | |
| '- turing1950: Turing, Alan M. (1950). Computing machinery and intelligence. https://doi.org/10.1093/mind/LIX.236.433', | |
| '- yok2023: (yazar yok) (2023). Uzaktan eğitim', | |
| '- tarihsiz: Yazar, Ad (t.y.). Kitap', | |
| ].join('\n'), | |
| ); | |
| assert.equal(bibliographySummary(['']), ''); | |
| }); | |