Ph0enixKM / Amber

💎 Amber the programming language compiled to bash
https://amber-lang.com
GNU General Public License v3.0
3.54k stars 70 forks source link

Add file_exist function to std #114

Closed clysto closed 1 month ago

clysto commented 1 month ago

How to write a test about file operations? I saw that the test does not include a test for file_read/file_write. Can you give me an example?

b1ek commented 1 month ago

How to write a test about file operations? I saw that the test does not include a test for file_read/file_write. Can you give me an example?

that is weird that there are no tests for those functions.

tests are written like this:

#[test]
fn name_of_the_test() {
    test_amber!("// put amber code here", "what the code should output");
}

i guess that if the other file functions are not covered for now, we could sweep that issue under the carpet in the scope of this PR. (see #117)

Ph0enixKM commented 1 month ago

I think that we will focus on std more in the next milestone. Right now we have to focus on making Amber usable in terms of making generated bash more user friendly and more debuggable I think. Although if you're adding file_exist function, please add dir_exist function as well @clysto. Thanks! The tests regarding STD will be added as soon as we improve the DX