Permalink
Browse files

test: simple file read/write variable value

  • Loading branch information...
1 parent ad30284 commit 196ab3e49c5869e4beeaf97394bf389fdd6fbcb7 @mpapis mpapis committed Aug 2, 2012
Showing with 16 additions and 4 deletions.
  1. +16 −4 core/internal/shell/variables/file/simple_file_comment_test.sh
@@ -3,10 +3,22 @@
source test-sm
includes internal/variables/file
-export _sm_version_read
-__sm_variables_file_read _sm_version_read VERSION
+export _sm_version_read1 _sm_version_read2
+__sm_variables_file_read _sm_version_read1 VERSION
# status=0
-# env[_sm_version_read]=/[[:digit:]\.]+/
+# env[_sm_version_read1]=/[[:digit:]\.]+/
-echo $_sm_version_read
+echo $_sm_version_read1
# match=/[[:digit:]\.]+/
+
+## write / read test
+_sm_version_read1=100
+[[ -f "${sm_temp_path}/VERSION" ]]
+# status!=0
+__sm_variables_file_write _sm_version_read1 "${sm_temp_path}/VERSION"
+# status=0
+[[ -f "${sm_temp_path}/VERSION" ]]
+# status=0
+__sm_variables_file_read _sm_version_read2 "${sm_temp_path}/VERSION"
+# status=0
+# env[_sm_version_read2]=/^100$/

0 comments on commit 196ab3e

Please sign in to comment.